AlexCool2024 commited on
Commit
9572852
·
verified ·
1 Parent(s): 4504b4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- "https://hf.space/embed/nttdataspain/Image-To-Text-Lora-ViT/api/predict",
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