amarax commited on
Commit
458a9b5
1 Parent(s): 94324d4

Finally properly working environment variables.

Browse files
Files changed (2) hide show
  1. .gitignore +1 -1
  2. app.py +2 -2
.gitignore CHANGED
@@ -2,4 +2,4 @@
2
  /__pycache__
3
  /image
4
 
5
- start.sh
 
2
  /__pycache__
3
  /image
4
 
5
+ start.*
app.py CHANGED
@@ -123,7 +123,7 @@ class ConversationBot:
123
  return state, state, f'{txt} {image_filename} '
124
 
125
  def init_agent(self, openai_api_key):
126
- self.llm = OpenAI(temperature=0, openai_api_key=openai_api_key)
127
  self.agent = initialize_agent(
128
  self.tools,
129
  self.llm,
@@ -171,7 +171,7 @@ with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:
171
  chatbot = gr.Chatbot(elem_id="chatbot", label="Visual ChatGPT")
172
  state = gr.State([])
173
 
174
- with gr.Row(visible=bot.agent) as input_raws:
175
  with gr.Column(scale=0.7):
176
  txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter, or upload an image").style(container=False)
177
  with gr.Column(scale=0.10, min_width=0):
 
123
  return state, state, f'{txt} {image_filename} '
124
 
125
  def init_agent(self, openai_api_key):
126
+ self.llm = OpenAI(temperature=0.5, max_tokens=512, openai_api_key=openai_api_key)
127
  self.agent = initialize_agent(
128
  self.tools,
129
  self.llm,
 
171
  chatbot = gr.Chatbot(elem_id="chatbot", label="Visual ChatGPT")
172
  state = gr.State([])
173
 
174
+ with gr.Row(visible=getattr(bot, 'agent', False)) as input_raws:
175
  with gr.Column(scale=0.7):
176
  txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter, or upload an image").style(container=False)
177
  with gr.Column(scale=0.10, min_width=0):