Spaces:
Sleeping
Sleeping
Update docs for root path
Browse files- .gitignore +1 -0
- app.py +2 -1
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
__pycache__
|
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
3 |
|
4 |
tokenizer = AutoTokenizer.from_pretrained("mayanklad/faq-canada-immigration-tokenizer")
|
5 |
model = AutoModelForCausalLM.from_pretrained("mayanklad/faq-canada-immigration")
|
6 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
7 |
-
app = FastAPI()
|
8 |
|
9 |
# Define a function to handle the GET request at `/generate`
|
10 |
# The generate() function is defined as a FastAPI route that takes a
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from fastapi.responses import RedirectResponse
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("mayanklad/faq-canada-immigration-tokenizer")
|
6 |
model = AutoModelForCausalLM.from_pretrained("mayanklad/faq-canada-immigration")
|
7 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
8 |
+
app = FastAPI(docs_url="/")
|
9 |
|
10 |
# Define a function to handle the GET request at `/generate`
|
11 |
# The generate() function is defined as a FastAPI route that takes a
|