Spaces:
Runtime error
Runtime error
update secrets
Browse files- app.py +1 -3
- requirements.txt +0 -1
app.py
CHANGED
@@ -1,15 +1,13 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
3 |
-
from huggingface_hub import login
|
4 |
# Create a new FastAPI app instance
|
5 |
app = FastAPI()
|
6 |
|
7 |
# Initialize the text generation pipeline
|
8 |
# This function will be able to generate text
|
9 |
# given an input.
|
10 |
-
login(token="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")
|
11 |
pipe = pipeline("text2text-generation",
|
12 |
-
model="visoc/Text2Question",use_auth_token=
|
13 |
|
14 |
# Define a function to handle the GET request at `/generate`
|
15 |
# The generate() function is defined as a FastAPI route that takes a
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
|
|
3 |
# Create a new FastAPI app instance
|
4 |
app = FastAPI()
|
5 |
|
6 |
# Initialize the text generation pipeline
|
7 |
# This function will be able to generate text
|
8 |
# given an input.
|
|
|
9 |
pipe = pipeline("text2text-generation",
|
10 |
+
model="visoc/Text2Question",use_auth_token="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")
|
11 |
|
12 |
# Define a function to handle the GET request at `/generate`
|
13 |
# The generate() function is defined as a FastAPI route that takes a
|
requirements.txt
CHANGED
@@ -4,5 +4,4 @@ uvicorn[standard]==0.17.*
|
|
4 |
sentencepiece==0.1.*
|
5 |
torch==1.11.*
|
6 |
transformers==4.*
|
7 |
-
huggingface_hub==0.14.*
|
8 |
protobuf==3.20.*
|
|
|
4 |
sentencepiece==0.1.*
|
5 |
torch==1.11.*
|
6 |
transformers==4.*
|
|
|
7 |
protobuf==3.20.*
|