Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,10 +34,13 @@ if uploaded_file is not None:
|
|
34 |
# Конвертация кадра в подходящий формат для отправки в модель
|
35 |
_, buf = cv2.imencode('.jpg', frame)
|
36 |
files = {'file': ('image.jpg', buf.tobytes(), 'image/jpeg')}
|
|
|
|
|
|
|
37 |
|
38 |
# Отправка изображения в модель
|
39 |
response = requests.post(
|
40 |
-
|
41 |
files=files
|
42 |
)
|
43 |
|
|
|
34 |
# Конвертация кадра в подходящий формат для отправки в модель
|
35 |
_, buf = cv2.imencode('.jpg', frame)
|
36 |
files = {'file': ('image.jpg', buf.tobytes(), 'image/jpeg')}
|
37 |
+
|
38 |
+
model_url = "https://api-inference.huggingface.co/models/nttdataspain/Image-To-Text-Lora-ViT"
|
39 |
+
headers = {"Authorization": f"Bearer {os.getenv('HUGGINGFACE_TOKEN_READ')}"}
|
40 |
|
41 |
# Отправка изображения в модель
|
42 |
response = requests.post(
|
43 |
+
model_url,
|
44 |
files=files
|
45 |
)
|
46 |
|