Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import pytesseract
|
|
| 4 |
from PIL import Image
|
| 5 |
import fitz
|
| 6 |
import io
|
| 7 |
-
|
| 8 |
import requests
|
| 9 |
import os
|
| 10 |
|
|
@@ -35,10 +35,13 @@ def find_most_relevant_context(contexts, question, max_features=10000):
|
|
| 35 |
|
| 36 |
API_URL = "https://api-inference.huggingface.co/models/google/gemma-7b"
|
| 37 |
headers = {"Authorization": f"Bearer {my_token}"}
|
|
|
|
| 38 |
|
| 39 |
def query(payload):
|
| 40 |
-
response = requests.post(API_URL, headers=headers, json=payload)
|
| 41 |
-
|
|
|
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import fitz
|
| 6 |
import io
|
| 7 |
+
from transformers import pipeline
|
| 8 |
import requests
|
| 9 |
import os
|
| 10 |
|
|
|
|
| 35 |
|
| 36 |
API_URL = "https://api-inference.huggingface.co/models/google/gemma-7b"
|
| 37 |
headers = {"Authorization": f"Bearer {my_token}"}
|
| 38 |
+
pipe = pipeline("text-generation", model="mistralai/Mixtral-8x7B-v0.1")
|
| 39 |
|
| 40 |
def query(payload):
|
| 41 |
+
# response = requests.post(API_URL, headers=headers, json=payload)
|
| 42 |
+
|
| 43 |
+
# return response.json()
|
| 44 |
+
return pipe(payload)
|
| 45 |
|
| 46 |
|
| 47 |
|