nnsohamnn commited on
Commit
0beee7d
·
verified ·
1 Parent(s): 8d5a3c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -19,7 +19,7 @@ model.load_state_dict(torch.load("Conv_GPT.pth", map_location=torch.device('cpu'
19
  model.eval()
20
 
21
  # Define generation function
22
- def generate_text(prompt, max_new_tokens=50):
23
  input_ids = tokenizer.encode(prompt, return_tensors='pt')
24
  # Ensure input sequence length does not exceed 512 (model's max_seq_len)
25
  if input_ids.size(1) > 512:
@@ -51,7 +51,7 @@ interface = gr.ChatInterface(
51
  GPT architecture, this model is trained on the DailyDialog dataset to
52
  provide conversational responses.""",
53
  theme="default",
54
- examples=["Hi, how are you?", "What's your favorite food?", "Tell me about your day."]
55
  )
56
 
57
 
 
19
  model.eval()
20
 
21
  # Define generation function
22
+ def generate_text(prompt, max_new_tokens=30):
23
  input_ids = tokenizer.encode(prompt, return_tensors='pt')
24
  # Ensure input sequence length does not exceed 512 (model's max_seq_len)
25
  if input_ids.size(1) > 512:
 
51
  GPT architecture, this model is trained on the DailyDialog dataset to
52
  provide conversational responses.""",
53
  theme="default",
54
+ examples=["Hi, how are you?", "Tell me a fun fact?"]
55
  )
56
 
57