Skip to content
Snippets Groups Projects
Commit fef4f87b authored by Tony Salomone's avatar Tony Salomone
Browse files

Pass source to model import.

parent 6a69ad62
Branches
Tags
No related merge requests found
...@@ -25,7 +25,7 @@ const fetcher = (url) => fetch(url).then((res) => res.json()); ...@@ -25,7 +25,7 @@ const fetcher = (url) => fetch(url).then((res) => res.json());
export default function ImportModelsModal({ open, setOpen}) { export default function ImportModelsModal({ open, setOpen}) {
const [importing, setImporting] = useState(false); const [importing, setImporting] = useState(false);
const [modelFolder, setModelFolder] = useState(null); const [modelFolder, setModelFolder] = useState(null); // Disabled folder support
const { const {
data: modelsData, data: modelsData,
...@@ -52,14 +52,15 @@ export default function ImportModelsModal({ open, setOpen}) { ...@@ -52,14 +52,15 @@ export default function ImportModelsModal({ open, setOpen}) {
let next = model_ids.next(); let next = model_ids.next();
while(!next.done) { while(!next.done) {
// In the iterator, each iteam is a key (model_id) and a value (blank) // In the iterator, each item is a key (model_id) and a value (model_source)
// this is just how it gets produced from the form // this is just how it gets produced from the form
const model_id = next.value[0]; const model_id = next.value[0];
const model_source = next.value[1];
console.log("Importing " + model_id); console.log("Importing " + model_id);
const response = await fetch( const response = await fetch(
// TODO: Hardcoding hugging face as model source for now as it's the only source // TODO: Hardcoding hugging face as model source for now as it's the only source
chatAPI.Endpoints.Models.ImportLocal("huggingface", model_id) chatAPI.Endpoints.Models.ImportLocal(model_source, model_id)
); );
// Read the response to see if it was successful and report any errors // Read the response to see if it was successful and report any errors
...@@ -202,7 +203,11 @@ export default function ImportModelsModal({ open, setOpen}) { ...@@ -202,7 +203,11 @@ export default function ImportModelsModal({ open, setOpen}) {
{row.installed {row.installed
? " " ? " "
: (row.supported : (row.supported
? <Checkbox name={row.id} defaultChecked /> ? <Checkbox
name={row.id}
value={row.source}
defaultChecked
/>
: <Checkbox disabled /> : <Checkbox disabled />
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment