Spaces:
Sleeping
Sleeping
Commit
·
fadcecc
1
Parent(s):
715ec34
json
Browse files- Dockerfile +1 -1
- main.py +1 -2
Dockerfile
CHANGED
|
@@ -8,4 +8,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
| 8 |
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
-
CMD ["gunicorn","-b", "0.0.0.0:7860", "main:app"]
|
|
|
|
| 8 |
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
+
CMD ["gunicorn","-b", "0.0.0.0:7860", "main:app"]
|
main.py
CHANGED
|
@@ -24,14 +24,13 @@ from linebot.v3.webhooks import (
|
|
| 24 |
import os
|
| 25 |
import requests
|
| 26 |
import logging
|
| 27 |
-
import json
|
| 28 |
|
| 29 |
HF_TOKEN = os.environ.get('HF_TOKEN')
|
| 30 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 31 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 32 |
def query(payload):
|
| 33 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 34 |
-
return
|
| 35 |
|
| 36 |
app = Flask(__name__)
|
| 37 |
|
|
|
|
| 24 |
import os
|
| 25 |
import requests
|
| 26 |
import logging
|
|
|
|
| 27 |
|
| 28 |
HF_TOKEN = os.environ.get('HF_TOKEN')
|
| 29 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 30 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 31 |
def query(payload):
|
| 32 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 33 |
+
return response.text
|
| 34 |
|
| 35 |
app = Flask(__name__)
|
| 36 |
|