isitcoding commited on
Commit
a672d1b
·
verified ·
1 Parent(s): ce16a38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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="gpt2", tokenizer="gpt2")
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": 50, # 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
 
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