Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ gpu = 0 if torch.cuda.is_available() else -1
|
|
12 |
# Initialize the text generation pipeline
|
13 |
# This function will be able to generate text
|
14 |
# given an input.
|
15 |
-
pipe = pipeline("text2text-generation", model="
|
16 |
|
17 |
# Define a function to handle the GET request at `/generate`
|
18 |
# The generate() function is defined as a FastAPI route that takes a
|
|
|
12 |
# Initialize the text generation pipeline
|
13 |
# This function will be able to generate text
|
14 |
# given an input.
|
15 |
+
pipe = pipeline("text2text-generation", model="gpt2",trust_remote_code=True,device=gpu)
|
16 |
|
17 |
# Define a function to handle the GET request at `/generate`
|
18 |
# The generate() function is defined as a FastAPI route that takes a
|