Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from transformers import pipeline
|
|
|
|
| 3 |
|
| 4 |
## create a new FASTAPI app instance
|
| 5 |
app=FastAPI()
|
| 6 |
|
| 7 |
# Initialize the text generation pipeline
|
| 8 |
-
pipe = pipeline("text2text-generation", model="meta-llama/Meta-Llama-3.1-8B-Instruct",token=HF_KEY)
|
| 9 |
|
| 10 |
|
| 11 |
@app.get("/")
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from transformers import pipeline
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
## create a new FASTAPI app instance
|
| 6 |
app=FastAPI()
|
| 7 |
|
| 8 |
# Initialize the text generation pipeline
|
| 9 |
+
pipe = pipeline("text2text-generation", model="meta-llama/Meta-Llama-3.1-8B-Instruct",token=os.getenv('HF_KEY'))
|
| 10 |
|
| 11 |
|
| 12 |
@app.get("/")
|