Spaces:
Sleeping
Sleeping
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -48,7 +48,7 @@ def multiclass_prediction(classifier, important_class): #made for hf zero-shot p
|
|
48 |
API_URL = "https://api-inference.huggingface.co/models"
|
49 |
headers = {"Authorization": f"Bearer {st.secrets['token']}"}
|
50 |
|
51 |
-
def query(data,
|
52 |
response = requests.post(API_URL + "/" + model_name, headers=headers, data=data)
|
53 |
while "error" in response.json():
|
54 |
response = requests.post(API_URL + "/" + model_name, headers=headers, data=data)
|
@@ -204,7 +204,10 @@ with vit:
|
|
204 |
st.write("loop iniciado")
|
205 |
for model in models:
|
206 |
i+=1
|
207 |
-
|
|
|
|
|
|
|
208 |
st.write("y gorrito cargado")
|
209 |
y_gorrito /= i
|
210 |
st.write("loop terminado")
|
|
|
48 |
API_URL = "https://api-inference.huggingface.co/models"
|
49 |
headers = {"Authorization": f"Bearer {st.secrets['token']}"}
|
50 |
|
51 |
+
def query(data, models): #HF API
|
52 |
response = requests.post(API_URL + "/" + model_name, headers=headers, data=data)
|
53 |
while "error" in response.json():
|
54 |
response = requests.post(API_URL + "/" + model_name, headers=headers, data=data)
|
|
|
204 |
st.write("loop iniciado")
|
205 |
for model in models:
|
206 |
i+=1
|
207 |
+
st.write("y gorrito a cargar")
|
208 |
+
a = query(uploaded_file.read(), model)
|
209 |
+
st.write("query terminado")
|
210 |
+
y_gorrito += a
|
211 |
st.write("y gorrito cargado")
|
212 |
y_gorrito /= i
|
213 |
st.write("loop terminado")
|