Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,13 @@ def generate_code(prompt):
|
|
32 |
temperature=0.7
|
33 |
)
|
34 |
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
demo = gr.Interface(
|
38 |
fn=generate_code,
|
|
|
32 |
temperature=0.7
|
33 |
)
|
34 |
|
35 |
+
output_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
36 |
+
|
37 |
+
# Strip the prompt if it appears at the start
|
38 |
+
if output_text.startswith(prompt):
|
39 |
+
output_text = output_text[len(prompt):].lstrip()
|
40 |
+
|
41 |
+
return output_text
|
42 |
|
43 |
demo = gr.Interface(
|
44 |
fn=generate_code,
|