kevinwang676 commited on
Commit
1e03cdc
1 Parent(s): 2ff7b06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -707,6 +707,27 @@ while run_server:
707
  ### <center>2. 更多精彩应用,尽在[滔滔AI](http://www.talktalkai.com);滔滔AI,为爱滔滔!💕</center>
708
  """
709
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  with gr.Tab("🐶 - Bark拟声"):
711
  with gr.Row():
712
  with gr.Column():
 
707
  ### <center>2. 更多精彩应用,尽在[滔滔AI](http://www.talktalkai.com);滔滔AI,为爱滔滔!💕</center>
708
  """
709
  )
710
+ with gr.Tab("Instruct mode"):
711
+ gr.Markdown(f"Raven is [RWKV 7B](https://github.com/BlinkDL/ChatRWKV) 100% RNN [RWKV-LM](https://github.com/BlinkDL/RWKV-LM) finetuned to follow instructions. *** Please try examples first (bottom of page) *** (edit them to use your question). Demo limited to ctxlen {ctx_limit}. Finetuned on alpaca, gpt4all, codealpaca and more. For best results, *** keep you prompt short and clear ***. <b>UPDATE: now with Chat (see above, as a tab) ==> turn off as of now due to VRAM leak caused by buggy code.</b>.")
712
+ with gr.Row():
713
+ with gr.Column():
714
+ instruction = gr.Textbox(lines=2, label="Instruction", value="Tell me about ravens.")
715
+ input = gr.Textbox(lines=2, label="Input", placeholder="none")
716
+ token_count = gr.Slider(10, 300, label="Max Tokens", step=10, value=300)
717
+ temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.2)
718
+ top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.5)
719
+ presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.4)
720
+ count_penalty = gr.Slider(0.0, 1.0, label="Count Penalty", step=0.1, value=0.4)
721
+ with gr.Column():
722
+ with gr.Row():
723
+ submit = gr.Button("Submit", variant="primary")
724
+ clear = gr.Button("Clear", variant="secondary")
725
+ output = gr.Textbox(label="Output", lines=5)
726
+ data = gr.Dataset(components=[instruction, input, token_count, temperature, top_p, presence_penalty, count_penalty], samples=examples, label="Example Instructions", headers=["Instruction", "Input", "Max Tokens", "Temperature", "Top P", "Presence Penalty", "Count Penalty"])
727
+ submit.click(evaluate, [instruction, input, token_count, temperature, top_p, presence_penalty, count_penalty], [output])
728
+ clear.click(lambda: None, [], [output])
729
+ data.click(lambda x: x, [data], [instruction, input, token_count, temperature, top_p, presence_penalty, count_penalty])
730
+
731
  with gr.Tab("🐶 - Bark拟声"):
732
  with gr.Row():
733
  with gr.Column():