Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,11 @@ def modify_code(file, prompt, model_name):
|
|
| 16 |
return "Model not supported."
|
| 17 |
|
| 18 |
# Generate the modified code based on the prompt
|
| 19 |
-
modified_code = generator(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Truncate the output to a maximum of 793,833 lines (or characters)
|
| 22 |
max_lines = 793833
|
|
|
|
| 16 |
return "Model not supported."
|
| 17 |
|
| 18 |
# Generate the modified code based on the prompt
|
| 19 |
+
modified_code = generator(
|
| 20 |
+
f"{prompt}\n{code}",
|
| 21 |
+
max_new_tokens=500, # Generate up to 500 new tokens
|
| 22 |
+
num_return_sequences=1
|
| 23 |
+
)[0]['generated_text']
|
| 24 |
|
| 25 |
# Truncate the output to a maximum of 793,833 lines (or characters)
|
| 26 |
max_lines = 793833
|