Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
import requests
|
| 3 |
from huggingface_hub import HfApi, ModelFilter, list_models, list_repo_files, hf_hub_download
|
| 4 |
api = HfApi()
|
|
@@ -12,7 +14,9 @@ def list_files(model_name):
|
|
| 12 |
|
| 13 |
def load_bin(model_name,file_name):
|
| 14 |
r = requests.get(f'https://huggingface.co/{model_name}/resolve/main/{file_name}')
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
#with open()
|
| 17 |
#file = open(f'{name}/{f_name}','wb')
|
| 18 |
#file = open(f'{name}/{f_name}','wb')
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import numpy
|
| 3 |
+
import torch
|
| 4 |
import requests
|
| 5 |
from huggingface_hub import HfApi, ModelFilter, list_models, list_repo_files, hf_hub_download
|
| 6 |
api = HfApi()
|
|
|
|
| 14 |
|
| 15 |
def load_bin(model_name,file_name):
|
| 16 |
r = requests.get(f'https://huggingface.co/{model_name}/resolve/main/{file_name}')
|
| 17 |
+
result=torch.Tensor(numpy.frombuffer(r.content, dtype=numpy.int32))
|
| 18 |
+
|
| 19 |
+
return result
|
| 20 |
#with open()
|
| 21 |
#file = open(f'{name}/{f_name}','wb')
|
| 22 |
#file = open(f'{name}/{f_name}','wb')
|