Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,9 @@ def generate(
|
|
28 |
seed=42,
|
29 |
)
|
30 |
|
31 |
-
formatted_prompt = format_prompt(prompt, history)
|
32 |
|
33 |
-
stream = client.text_generation(
|
34 |
output = ""
|
35 |
|
36 |
for response in stream:
|
@@ -46,8 +46,8 @@ def health():
|
|
46 |
def search_route():
|
47 |
data = request.get_json()
|
48 |
prompt = data.get('prompt', '')
|
49 |
-
truncated_prompt = prompt[:32768]
|
50 |
-
return Response(generate(
|
51 |
|
52 |
if __name__ == '__main__':
|
53 |
app.run(debug=False, host='0.0.0.0', port=7860)
|
|
|
28 |
seed=42,
|
29 |
)
|
30 |
|
31 |
+
#formatted_prompt = format_prompt(prompt, history)
|
32 |
|
33 |
+
stream = client.text_generation(prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
34 |
output = ""
|
35 |
|
36 |
for response in stream:
|
|
|
46 |
def search_route():
|
47 |
data = request.get_json()
|
48 |
prompt = data.get('prompt', '')
|
49 |
+
#truncated_prompt = prompt[:32768]
|
50 |
+
return Response(generate(prompt), content_type='text/plain', status=200, direct_passthrough=True)
|
51 |
|
52 |
if __name__ == '__main__':
|
53 |
app.run(debug=False, host='0.0.0.0', port=7860)
|