Thai Tran commited on
Commit
85de918
β€’
1 Parent(s): d0bb947

Added description

Browse files
Files changed (3) hide show
  1. README.md +16 -3
  2. app.py +5 -1
  3. config.yaml +6 -1
README.md CHANGED
@@ -1,13 +1,26 @@
1
  ---
2
  title: WebChat
3
- emoji: πŸš€
4
  colorFrom: pink
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 3.39.0
8
  app_file: app.py
9
- pinned: false
10
  license: mit
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: WebChat
3
+ emoji: πŸ¦™πŸŒ
4
  colorFrom: pink
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 3.39.0
8
  app_file: app.py
9
+ pinned: true
10
  license: mit
11
  ---
12
 
13
+ # WebChat
14
+
15
+ This is a [Llama 2 (70B)](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) chatbot that can access Google Search and webpages to answer questions.
16
+
17
+ * See the [WebChat Github repo](https://github.com/thaitran/WebChat) for a version that you can run on your computer that supports GPT-3.5, GPT-4, Claude 2 and can control Chrome, Firefox, Safari, or Edge.
18
+
19
+ * See [this article](https://medium.com/@thait/) for an explanation of how this chatbot works.
20
+
21
+ ## Feedback
22
+
23
+ If you'd like to provide feedback, you can reach the author at:
24
+ * LinkedIn: https://www.linkedin.com/in/thait/
25
+ * Twitter: [@thait](https://twitter.com/thait)
26
+ * Threads: [@thai](https://www.threads.net/@thai)
app.py CHANGED
@@ -9,10 +9,10 @@ from tools import Tools
9
  SYSTEM_MESSAGE_TEMPLATE = "prompt.txt"
10
 
11
  MODELS = {
12
- "LLaMA 2": HuggingFaceLlama2Model("meta-llama/Llama-2-70b-chat-hf", 4096),
13
  "GPT-3.5": OpenAIModel("gpt-3.5-turbo-16k", 16384),
14
  "GPT-4": OpenAIModel("gpt-4", 8192),
15
  "Claude 2": AnthropicModel("claude-2", 100000),
 
16
  }
17
 
18
  # Load configuration from config.yaml.
@@ -27,6 +27,7 @@ with open("config.yaml", "r") as config_file:
27
  config = yaml.safe_load(config_file)
28
 
29
  verbose = config["verbose"]
 
30
  examples = config["examples"]
31
  enabled_models = config["enabled_models"]
32
  selected_model = enabled_models[0]
@@ -183,6 +184,8 @@ if verbose:
183
  print(system_message)
184
 
185
  CSS = """
 
 
186
  .contain { display: flex; flex-direction: column; }
187
  .gradio-container { height: 100vh !important; }
188
  #component-0 { flex-grow: 1; overflow: auto; }
@@ -193,6 +196,7 @@ multiple_models_enabled = len(enabled_models) > 1
193
  multiple_browsers_enabled = len(enabled_browsers) > 1
194
 
195
  with gr.Blocks(css=CSS) as app:
 
196
  chatinterface = gr.ChatInterface(fn=generate, examples=examples)
197
  chatinterface.chatbot.elem_id = "chatbot"
198
 
 
9
  SYSTEM_MESSAGE_TEMPLATE = "prompt.txt"
10
 
11
  MODELS = {
 
12
  "GPT-3.5": OpenAIModel("gpt-3.5-turbo-16k", 16384),
13
  "GPT-4": OpenAIModel("gpt-4", 8192),
14
  "Claude 2": AnthropicModel("claude-2", 100000),
15
+ "Llama 2": HuggingFaceLlama2Model("meta-llama/Llama-2-70b-chat-hf", 4096),
16
  }
17
 
18
  # Load configuration from config.yaml.
 
27
  config = yaml.safe_load(config_file)
28
 
29
  verbose = config["verbose"]
30
+ description = config["description"]
31
  examples = config["examples"]
32
  enabled_models = config["enabled_models"]
33
  selected_model = enabled_models[0]
 
184
  print(system_message)
185
 
186
  CSS = """
187
+ h1 { text-align: center; }
188
+ h3 { text-align: center; }
189
  .contain { display: flex; flex-direction: column; }
190
  .gradio-container { height: 100vh !important; }
191
  #component-0 { flex-grow: 1; overflow: auto; }
 
196
  multiple_browsers_enabled = len(enabled_browsers) > 1
197
 
198
  with gr.Blocks(css=CSS) as app:
199
+ gr.Markdown(description)
200
  chatinterface = gr.ChatInterface(fn=generate, examples=examples)
201
  chatinterface.chatbot.elem_id = "chatbot"
202
 
config.yaml CHANGED
@@ -1,5 +1,10 @@
1
  verbose: False
2
 
 
 
 
 
 
3
  examples:
4
  - Which bank offers the best savings rate?
5
  - Is it possible to build a room temperature superconductor?
@@ -8,7 +13,7 @@ examples:
8
  - Summarize today's nytimes.com headlines
9
 
10
  enabled_models:
11
- - LLaMA 2
12
  #- GPT-3.5
13
  #- GPT-4
14
  #- Claude 2
 
1
  verbose: False
2
 
3
+ description: "# WebChat
4
+
5
+ ### This is a [Llama 2 (70B)](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) chatbot that can access Google Search and webpages to answer questions
6
+ [[How it works](https://medium.com/@thait/)] [[Code](https://github.com/thaitran/WebChat)]"
7
+
8
  examples:
9
  - Which bank offers the best savings rate?
10
  - Is it possible to build a room temperature superconductor?
 
13
  - Summarize today's nytimes.com headlines
14
 
15
  enabled_models:
16
+ - Llama 2
17
  #- GPT-3.5
18
  #- GPT-4
19
  #- Claude 2