Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,6 @@ tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
|
| 8 |
model = AutoModelForCausalLM.from_pretrained("gpt2")
|
| 9 |
|
| 10 |
print("Loading finished.")
|
| 11 |
-
global n_steps=12
|
| 12 |
-
global n_beams=1
|
| 13 |
-
global length_penalty=1
|
| 14 |
-
global num_return_sequences=3
|
| 15 |
|
| 16 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 17 |
# True
|
|
@@ -485,7 +481,10 @@ with gr.Blocks(
|
|
| 485 |
value="Hugging Face is",
|
| 486 |
)
|
| 487 |
|
| 488 |
-
|
|
|
|
|
|
|
|
|
|
| 489 |
button = gr.Button()
|
| 490 |
out_html = gr.Markdown()
|
| 491 |
out_markdown = gr.Markdown()
|
|
|
|
| 8 |
model = AutoModelForCausalLM.from_pretrained("gpt2")
|
| 9 |
|
| 10 |
print("Loading finished.")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 13 |
# True
|
|
|
|
| 481 |
value="Hugging Face is",
|
| 482 |
)
|
| 483 |
|
| 484 |
+
n_steps=12
|
| 485 |
+
n_beams=1
|
| 486 |
+
length_penalty=1
|
| 487 |
+
num_return_sequences=3
|
| 488 |
button = gr.Button()
|
| 489 |
out_html = gr.Markdown()
|
| 490 |
out_markdown = gr.Markdown()
|