microhum commited on
Commit
5d25460
·
1 Parent(s): 941c7c6

fix deploy ip

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -33,14 +33,21 @@ def generate_response(chat_input: str, bot_message: str) -> Generator[str, str,
33
  print("Error:", response.status_code, response.text)
34
  return f"Error: {response.status_code}, {response.text}"
35
 
36
- with gr.Blocks() as demo:
37
- with gr.Column():
 
 
 
 
38
 
39
- chatbot = gr.ChatInterface(
40
- fn=generate_response,
41
- title="AskmeAboutRAG Chat",
42
- description="RAG model for asking about RAG",
43
- )
 
 
 
44
 
45
  if __name__ == "__main__":
46
  demo.launch(server_name = "0.0.0.0")
 
33
  print("Error:", response.status_code, response.text)
34
  return f"Error: {response.status_code}, {response.text}"
35
 
36
+ CSS ="""
37
+ .contain { display: flex; flex-direction: column; }
38
+ .gradio-container { height: 100vh !important; }
39
+ #component-0 { height: 100%; }
40
+ #chatbot { flex-grow: 1; overflow: auto;}
41
+ """
42
 
43
+ with gr.Blocks() as demo:
44
+ chatbot = gr.Chatbot(elem_id="chatbot")
45
+ chatbot = gr.ChatInterface(
46
+ fn=generate_response,
47
+ title="AskmeAboutRAG Chat",
48
+ description="RAG model for asking about RAG",
49
+ chatbot=chatbot,
50
+ )
51
 
52
  if __name__ == "__main__":
53
  demo.launch(server_name = "0.0.0.0")