Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Initialize the text generation pipeline
|
5 |
-
generator = pipeline("text-generation", model="
|
6 |
|
7 |
# Define the response function with additional options for customization
|
8 |
def text_generation(
|
@@ -20,7 +20,7 @@ def text_generation(
|
|
20 |
):
|
21 |
# Setup the configuration for the model generation
|
22 |
gen_params = {
|
23 |
-
"max_length":
|
24 |
"num_return_sequences": 1,
|
25 |
"do_sample": do_sample,
|
26 |
"temperature": 0.7, # Controls randomness
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Initialize the text generation pipeline
|
5 |
+
generator = pipeline("text-generation", model="isitcoding/gpt2_120_finetuned", tokenizer="isitcoding/gpt2_120_finetuned")
|
6 |
|
7 |
# Define the response function with additional options for customization
|
8 |
def text_generation(
|
|
|
20 |
):
|
21 |
# Setup the configuration for the model generation
|
22 |
gen_params = {
|
23 |
+
"max_length": 518, # Default, you can tweak it or set from parameters
|
24 |
"num_return_sequences": 1,
|
25 |
"do_sample": do_sample,
|
26 |
"temperature": 0.7, # Controls randomness
|