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

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. gpt_dev.py +1 -1
app.py CHANGED
@@ -35,11 +35,10 @@ interface = gr.Interface(
35
  fn=gradio_interface,
36
  inputs=[
37
  gr.Textbox(label="Prompt", value="Once upon a time"),
38
- gr.Slider(50, 300, step=1, value=75, label="Max Length"),
39
- gr.Slider(0.1, 1.5, step=0.1, value=1.0, label="Temperature")
40
  ],
41
  outputs="text",
42
- title="GPT Text Generation",
43
  description="Enter a prompt to generate text."
44
  )
45
 
 
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",
42
  description="Enter a prompt to generate text."
43
  )
44
 
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=300, 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=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]