Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,11 @@ def generate(
|
|
| 44 |
top_p=0.75,
|
| 45 |
top_k=40,):
|
| 46 |
result = ""
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
result += x['choices'][0]['text']
|
| 49 |
yield result
|
| 50 |
|
|
|
|
| 44 |
top_p=0.75,
|
| 45 |
top_k=40,):
|
| 46 |
result = ""
|
| 47 |
+
if input:
|
| 48 |
+
ins_inp(instruction, input)
|
| 49 |
+
else:
|
| 50 |
+
ins.format(instruction)
|
| 51 |
+
for x in llm(instruction, stop=['### Instruction:', '### End'], stream=True, temperature=temperature, top_p=top_p, top_k=top_k):
|
| 52 |
result += x['choices'][0]['text']
|
| 53 |
yield result
|
| 54 |
|