Spaces:
Sleeping
Sleeping
Commit ·
7995ffa
1
Parent(s): 84f1220
fix max tokens
Browse files
app.py
CHANGED
|
@@ -15,14 +15,14 @@ def decomp_create_prompt(input_data: str) -> str:
|
|
| 15 |
return prompt
|
| 16 |
|
| 17 |
|
| 18 |
-
pipe = pipeline(model="ejschwartz/decaf-v1-22b-4bit", return_full_text=False
|
| 19 |
pipe.model.to("cuda")
|
| 20 |
|
| 21 |
@spaces.GPU
|
| 22 |
def generate(text):
|
| 23 |
print(f"Generating text... {text}")
|
| 24 |
prompt = decomp_create_prompt(text)
|
| 25 |
-
return pipe(prompt)[0]['generated_text']
|
| 26 |
|
| 27 |
demo = gr.Interface(fn=generate, inputs="text", outputs="text")
|
| 28 |
demo.launch()
|
|
|
|
| 15 |
return prompt
|
| 16 |
|
| 17 |
|
| 18 |
+
pipe = pipeline(model="ejschwartz/decaf-v1-22b-4bit", return_full_text=False)
|
| 19 |
pipe.model.to("cuda")
|
| 20 |
|
| 21 |
@spaces.GPU
|
| 22 |
def generate(text):
|
| 23 |
print(f"Generating text... {text}")
|
| 24 |
prompt = decomp_create_prompt(text)
|
| 25 |
+
return pipe(prompt, max_new_tokens=2000)[0]['generated_text']
|
| 26 |
|
| 27 |
demo = gr.Interface(fn=generate, inputs="text", outputs="text")
|
| 28 |
demo.launch()
|