Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -42,16 +42,17 @@ class ModelManager:
|
|
42 |
|
43 |
models = []
|
44 |
for config in model_configs:
|
45 |
-
with
|
46 |
-
model_path = os.path.join(tmpdir, config['filename'])
|
47 |
download_url = f"https://huggingface.co/{config['repo_id']}/resolve/main/{config['filename']}"
|
48 |
response = requests.get(download_url, headers={"Authorization": f"Bearer {HUGGINGFACE_TOKEN}"})
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
models.append(model)
|
53 |
|
54 |
-
|
|
|
55 |
self.unified_model = models[0]
|
56 |
return self.unified_model
|
57 |
|
|
|
42 |
|
43 |
models = []
|
44 |
for config in model_configs:
|
45 |
+
with BytesIO() as model_data:
|
|
|
46 |
download_url = f"https://huggingface.co/{config['repo_id']}/resolve/main/{config['filename']}"
|
47 |
response = requests.get(download_url, headers={"Authorization": f"Bearer {HUGGINGFACE_TOKEN}"})
|
48 |
+
model_data.write(response.content)
|
49 |
+
model_data.seek(0)
|
50 |
+
|
51 |
+
model = Llama(model_path=" ", model_data=model_data.read(), **self.params)
|
52 |
models.append(model)
|
53 |
|
54 |
+
self.params["tokens"] = models[0].tokenize(b"Hello")
|
55 |
+
|
56 |
self.unified_model = models[0]
|
57 |
return self.unified_model
|
58 |
|