Jonas Wiesli commited on
Commit
0944853
1 Parent(s): 11e6e38
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import os
3
  import openai
4
 
5
- openai.api_key = "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"
6
 
7
  with gr.Blocks() as iface:
8
  chatbot = []
@@ -28,8 +28,6 @@ with gr.Blocks() as iface:
28
  "You are a Conservationist. ",
29
  "You are a Guide. "]
30
 
31
- questionsLeft = 24
32
-
33
  i = 0
34
  while i < len(roles):
35
  with gr.Tab(roles[i]):
@@ -51,8 +49,8 @@ with gr.Blocks() as iface:
51
  def generateAIMessage(history, characterId):
52
  message_history = [
53
  {"role": "system", "content": initText[characterId] + "Stay in character. Use natural language. Don't "
54
- "reveal all of the information in a single message, "
55
- "and leave hints. "}
56
  ]
57
  for pair in history:
58
  message_history.append({"role": "user", "content": pair[0]})
@@ -68,7 +66,7 @@ with gr.Blocks() as iface:
68
  i = 0
69
  while i < len(msg):
70
  msg[i].submit(user, [msg[i], chatbot[i]], [msg[i], chatbot[i]], queue=False).then(
71
- bot, chatbot[i], chatbot[i]
72
  )
73
  i += 1
74
 
 
2
  import os
3
  import openai
4
 
5
+ openai.api_key = "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"
6
 
7
  with gr.Blocks() as iface:
8
  chatbot = []
 
28
  "You are a Conservationist. ",
29
  "You are a Guide. "]
30
 
 
 
31
  i = 0
32
  while i < len(roles):
33
  with gr.Tab(roles[i]):
 
49
  def generateAIMessage(history, characterId):
50
  message_history = [
51
  {"role": "system", "content": initText[characterId] + "Stay in character. Use natural language. Don't "
52
+ "reveal all of the information in a single message,"
53
+ " and leave hints. "}
54
  ]
55
  for pair in history:
56
  message_history.append({"role": "user", "content": pair[0]})
 
66
  i = 0
67
  while i < len(msg):
68
  msg[i].submit(user, [msg[i], chatbot[i]], [msg[i], chatbot[i]], queue=False).then(
69
+ bot, [chatbot[i], i], chatbot[i]
70
  )
71
  i += 1
72