praty7717 commited on
Commit
c9bd5f7
·
verified ·
1 Parent(s): 5dd54ce

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. gpt_dev.py +1 -1
app.py CHANGED
@@ -35,7 +35,7 @@ interface = gr.Interface(
35
  fn=gradio_interface,
36
  inputs=[
37
  gr.Textbox(label="Prompt", value="Once upon a time"),
38
- gr.Slider(50, 100, step=1, value=75, label="Max Length"),
39
  ],
40
  outputs="text",
41
  title="Odeyssey Rhyme Generator",
 
35
  fn=gradio_interface,
36
  inputs=[
37
  gr.Textbox(label="Prompt", value="Once upon a time"),
38
+ gr.Slider(100, 256, step=1, value=75, label="Max Length"),
39
  ],
40
  outputs="text",
41
  title="Odeyssey Rhyme Generator",
gpt_dev.py CHANGED
@@ -425,7 +425,7 @@ a = a / torch.sum(a, 1, keepdim = True)
425
  b = torch.randint(0, 10, (3, 2)).float()
426
  c = a @ b
427
 
428
- def generate_text(model, start_prompt, max_length=100, temperature=1.0):
429
  input_ids = torch.tensor(encode(start_prompt), dtype=torch.long).unsqueeze(0).to(device)
430
  model.eval()
431
  generated_ids = input_ids.tolist()[0]
 
425
  b = torch.randint(0, 10, (3, 2)).float()
426
  c = a @ b
427
 
428
+ def generate_text(model, start_prompt, max_length=256, temperature=1.0):
429
  input_ids = torch.tensor(encode(start_prompt), dtype=torch.long).unsqueeze(0).to(device)
430
  model.eval()
431
  generated_ids = input_ids.tolist()[0]