Tim Seufert commited on
Commit
5463f9d
·
1 Parent(s): d5bee63

update interface beta test2

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -24,11 +24,10 @@ def respond(message, chat_history):
24
  message_content = message
25
 
26
  try:
27
- # Generate response using Cohere
28
- response = co.generate(
29
  model='command-xlarge-nightly', # Ensure the correct model ID is used
30
- prompt=f"{prompt} '{message_content}'",
31
- max_tokens=100,
32
  temperature=0.3,
33
  k=0,
34
  p=0.75,
@@ -44,11 +43,6 @@ def respond(message, chat_history):
44
  except Exception as e:
45
  return str(e), chat_history
46
 
47
- def slow_echo(message, history):
48
- for i in range(len(message)):
49
- time.sleep(0.05)
50
- yield "You typed: " + message[: i + 1]
51
-
52
  # Create Gradio interface
53
  demo = gr.ChatInterface(
54
  respond,
 
24
  message_content = message
25
 
26
  try:
27
+ # Generate response using Cohere chat API
28
+ response = co.chat(
29
  model='command-xlarge-nightly', # Ensure the correct model ID is used
30
+ query=f"{prompt} '{message_content}'",
 
31
  temperature=0.3,
32
  k=0,
33
  p=0.75,
 
43
  except Exception as e:
44
  return str(e), chat_history
45
 
 
 
 
 
 
46
  # Create Gradio interface
47
  demo = gr.ChatInterface(
48
  respond,