lruizap commited on
Commit
114444e
ยท
1 Parent(s): d288670

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -15,17 +15,15 @@ model = AutoModelForSeq2SeqLM.from_pretrained(
15
  # zephyr
16
  # pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha",torch_dtype=torch.bfloat16, device_map="auto")
17
 
18
- def generate(inputuno, inputdos, max_new_tokens=3556, top_p=0.95, repetition_penalty=1.0):
19
- top_p = float(top_p)
20
-
21
  prompt = inputuno
22
  promptdos = inputdos
23
 
24
  generate_kwargs = dict(
25
- temperature=fixed_temperature,
26
- max_new_tokens=max_new_tokens,
27
- top_p=top_p,
28
- repetition_penalty=repetition_penalty,
29
  do_sample=True,
30
  seed=42,
31
  )
@@ -64,6 +62,6 @@ examples = [["photographer"], ["developer"], ["teacher"], [
64
  "human resources staff"], ["recipe for ham croquettes"]]
65
  description = ""
66
 
67
- PerfectGPT = gr.Interface(generate, inputs=[input_prompt, input_promptdos], outputs=output_component, examples=examples, title="๐Ÿ—ฟ PerfectGPT v1 ๐Ÿ—ฟ", description=description)
68
 
69
  PerfectGPT.launch()
 
15
  # zephyr
16
  # pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha",torch_dtype=torch.bfloat16, device_map="auto")
17
 
18
+ def generateZep(inputuno, inputdos):
 
 
19
  prompt = inputuno
20
  promptdos = inputdos
21
 
22
  generate_kwargs = dict(
23
+ temperature=0.9,
24
+ max_new_tokens=3556,
25
+ top_p=float(0.95),
26
+ repetition_penalty=1.0,
27
  do_sample=True,
28
  seed=42,
29
  )
 
62
  "human resources staff"], ["recipe for ham croquettes"]]
63
  description = ""
64
 
65
+ PerfectGPT = gr.Interface(fn=generateZep, inputs=[input_prompt, input_promptdos], outputs=output_component, examples=examples, title="๐Ÿ—ฟ PerfectGPT v1 ๐Ÿ—ฟ", description=description)
66
 
67
  PerfectGPT.launch()