Sentdex commited on
Commit
fb4b4f3
Β·
1 Parent(s): 6fb871a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -34,6 +34,15 @@ tokenizer = transformers.AutoTokenizer.from_pretrained(
34
  )
35
 
36
 
 
 
 
 
 
 
 
 
 
37
  def prompt_build(system_prompt, user_inp, hist):
38
  prompt = f"""### System:\n{system_prompt}\n\n"""
39
 
@@ -70,6 +79,7 @@ def chat(user_input, history, system_prompt):
70
 
71
 
72
  with gr.Blocks() as demo:
 
73
  system_prompt = gr.Textbox("You are helpful AI.", label="System Prompt")
74
  chatbot = gr.ChatInterface(fn=chat, additional_inputs=[system_prompt])
75
 
 
34
  )
35
 
36
 
37
+ DESCRIPTION = """
38
+ # Stable Beluga 7B Chat
39
+ This is a streaming Chat Interface implementation of [StableBeluga-7B](https://huggingface.co/stabilityai/StableBeluga-7B)
40
+ You can modify the system prompt, which can be quite fun. For example, you can try something like "You are a mean AI. Phrase all replies as insults" for a good laugh.
41
+
42
+ Sometimes the model doesn't appropriately hit its stop token. Feel free to hit "stop" and "retry" if this happens to you. Or PR a fix to stop the stream if the tokens for User: get hit or something.
43
+ """
44
+
45
+
46
  def prompt_build(system_prompt, user_inp, hist):
47
  prompt = f"""### System:\n{system_prompt}\n\n"""
48
 
 
79
 
80
 
81
  with gr.Blocks() as demo:
82
+ gr.Markdown(DESCRIPTION)
83
  system_prompt = gr.Textbox("You are helpful AI.", label="System Prompt")
84
  chatbot = gr.ChatInterface(fn=chat, additional_inputs=[system_prompt])
85