Spaces:
Sleeping
Sleeping
Revert "Update app.py"
Browse filesThis reverts commit 9a9676f8b1c4b7e8a42405f645e61dbb4fb39c51.
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,13 +35,10 @@ 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 |
-
pipe = pipeline("text-generation", model="mistralai/Mixtral-8x7B-v0.1")
|
| 39 |
|
| 40 |
def query(payload):
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
# return response.json()
|
| 44 |
-
return pipe(payload)
|
| 45 |
|
| 46 |
|
| 47 |
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import fitz
|
| 6 |
import io
|
| 7 |
+
|
| 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 |
|
| 39 |
def query(payload):
|
| 40 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 41 |
+
return response.json()
|
|
|
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
|