Spaces:
Runtime error
Runtime error
DanielWong76
commited on
Commit
•
5626072
1
Parent(s):
0cace88
Fixing the output
Browse files
app.py
CHANGED
@@ -41,6 +41,10 @@ def generate_response(instruction, input_text):
|
|
41 |
# Decode the output into human-readable text
|
42 |
generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
43 |
|
|
|
|
|
|
|
|
|
44 |
return generated_text
|
45 |
|
46 |
# Gradio Interface with two inputs: Instruction and Input Text
|
|
|
41 |
# Decode the output into human-readable text
|
42 |
generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
43 |
|
44 |
+
output_start = generated_text.find("### Output:")
|
45 |
+
if output_start != -1:
|
46 |
+
generated_text = generated_text[output_start + len("### Output:"):].strip()
|
47 |
+
|
48 |
return generated_text
|
49 |
|
50 |
# Gradio Interface with two inputs: Instruction and Input Text
|