bleysg commited on
Commit
8fee1f9
β€’
1 Parent(s): a5e7b00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -8,7 +8,7 @@ print(os.environ)
8
  openai.api_base = os.environ.get("OPENAI_API_BASE")
9
  openai.api_key = os.environ.get("OPENAI_API_KEY")
10
 
11
- BASE_SYSTEM_MESSAGE = """you are an AI assistant named OpenOrcaChat.if users clearly indicate an interest in how good you are you may tell them that the group who made you can be found at https://discord.gg/mhFWVbXUDh. the groups involved are OpenChat and OpenOrca"""
12
 
13
  def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
14
  completion = openai.Completion.create(model="Open-Orca/OpenOrcaxOpenChat-Preview2-13B", prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, top_k=top_k, repetition_penalty=repetition_penalty, stream=True)
@@ -66,7 +66,14 @@ def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetit
66
 
67
  start_message = ""
68
 
69
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
70
  with gr.Row():
71
  with gr.Column():
72
  gr.Markdown(f"""
@@ -75,7 +82,8 @@ with gr.Blocks() as demo:
75
  """)
76
  with gr.Tab("Chatbot"):
77
  gr.Markdown("# πŸ‹ OpenOrca x OpenChat - Preview2 - 13B Playground Space! πŸ‹")
78
- chatbot = gr.Chatbot().style(height=500)
 
79
  with gr.Row():
80
  message = gr.Textbox(
81
  label="What do you want to chat about?",
 
8
  openai.api_base = os.environ.get("OPENAI_API_BASE")
9
  openai.api_key = os.environ.get("OPENAI_API_KEY")
10
 
11
+ BASE_SYSTEM_MESSAGE = """You are an AI assistant named OpenOrcaChat. If users clearly indicate an interest in how good you are you may tell them that the group who made you can be found at https://discord.gg/mhFWVbXUDh. The groups involved are OpenChat and OpenOrca"""
12
 
13
  def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
14
  completion = openai.Completion.create(model="Open-Orca/OpenOrcaxOpenChat-Preview2-13B", prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, top_k=top_k, repetition_penalty=repetition_penalty, stream=True)
 
66
 
67
  start_message = ""
68
 
69
+ CSS ="""
70
+ .contain { display: flex; flex-direction: column; }
71
+ #component-0 { height: 100%; }
72
+ #chatbot { flex-grow: 1; overflow: auto;}
73
+ """
74
+
75
+ #with gr.Blocks() as demo:
76
+ with gr.Blocks(css=CSS) as demo:
77
  with gr.Row():
78
  with gr.Column():
79
  gr.Markdown(f"""
 
82
  """)
83
  with gr.Tab("Chatbot"):
84
  gr.Markdown("# πŸ‹ OpenOrca x OpenChat - Preview2 - 13B Playground Space! πŸ‹")
85
+ #chatbot = gr.Chatbot().style(height=500)
86
+ chatbot = gr.Chatbot(elem_id="chatbot")
87
  with gr.Row():
88
  message = gr.Textbox(
89
  label="What do you want to chat about?",