chansung commited on
Commit
257ebf8
·
1 Parent(s): d928497

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -23,6 +23,14 @@ model, tokenizer = load_model(
23
 
24
  stream_model = StreamModel(model, tokenizer)
25
 
 
 
 
 
 
 
 
 
26
  bot_summarized_response = ''
27
  # user input should be appropriately formatted (don't be confused by the function name)
28
  instruction_display = common_post_process(instruction)
 
23
 
24
  stream_model = StreamModel(model, tokenizer)
25
 
26
+ def chat_stream(
27
+ context,
28
+ instruction,
29
+ state_chatbot,
30
+ ):
31
+ if len(context) > 1000 or len(instruction) > 300:
32
+ raise gr.Error("context or prompt is too long!")
33
+
34
  bot_summarized_response = ''
35
  # user input should be appropriately formatted (don't be confused by the function name)
36
  instruction_display = common_post_process(instruction)