awacke1 commited on
Commit
9d602a8
โ€ข
1 Parent(s): 94063a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -40
app.py CHANGED
@@ -93,8 +93,43 @@ with gr.Blocks(css=css) as demo:
93
 
94
  gr.ChatInterface(
95
  generate,
96
- additional_inputs=additional_inputs,
97
- markdown="""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  | Feature | Description | Byline |
99
  |---------|-------------|--------|
100
  | ๐ŸชŸ Sliding Window Attention with 128K tokens span | Enables the model to have a larger context for each token. | Increases model's understanding of context, resulting in more coherent and contextually relevant outputs. |
@@ -131,43 +166,7 @@ with gr.Blocks(css=css) as demo:
131
 
132
  - ๐Ÿ“ˆ Expected speedups with Flash Attention 2
133
  - **Byline**: Keep an eye out for this update to benefit from performance gains.
134
-
135
  """
136
-
137
-
138
- gr.Markdown(markdown)
139
- examples = [
140
- ["๐Ÿฐ Welcome to the Kingdom of Elandria! You are Jim and Tim, two bumbling bros with a knack for mischief. ๐Ÿคด๐Ÿคด [Action: Introduce yourselves, Equipment: Scepters of Foolishness]"],
141
- ["๐ŸŒฒ You find yourselves in a forest filled with magical creatures and oddly specific 'Do Not Disturb' signs. ๐Ÿฆ„ [Action: Proceed cautiously, Equipment: Map of Social Etiquette]"],
142
- ["๐Ÿป You stumble upon a dwarf tavern. They offer you 'Beard Beer.' Do you drink it? ๐Ÿบ [Action: Chug or Pass, Equipment: Empty Mugs]"],
143
- ["๐Ÿ‰ A vegan dragon appears and chastises you for your leather boots. What do you do? ๐Ÿ—ก๏ธ๐Ÿƒ [Action: Apologize and offer kale, Equipment: Non-leather sandals]"],
144
- ["๐Ÿ’Ž You find a treasure chest labeled 'Not a Mimic.' Seems legit. Do you open it? ๐Ÿ—๏ธ [Action: Open or No way, Equipment: Mimic Repellent]"],
145
- ["๐Ÿฆ‡ You're swarmed by bats in a cave. One bat offers you 'organic guano.' How do you react? ๐Ÿ•ฏ๏ธ [Action: Politely decline, Equipment: Nose Plugs]"],
146
- ["๐Ÿ”ฎ A mysterious sorcerer offers you a 'Love Potion No. 9ยฝ.' Do you take a sip? ๐Ÿถ [Action: Sip or Skip, Equipment: Breath Mints]"],
147
- ["โš”๏ธ Bandits demand gold, but they accept credit cards. What's your move? ๐Ÿ’ฐ [Action: Pay or Pray, Equipment: Wallets]"],
148
- ["๐Ÿšช A door with three locks and a sign saying 'Beware of the Dog.' Do you search for the keys or try to pet the dog? ๐Ÿ—๏ธ๐Ÿ’ช [Action: Unlock or Pet, Equipment: Dog Treats]"],
149
- ["๐ŸŒŠ A river blocks your path. A mermaid offers to carry you across for a 'small' fee. ๐ŸŠโ€โ™€๏ธ๐ŸŒ‰ [Action: Accept or Decline, Equipment: Bargaining Skills]"],
150
- ["๐Ÿฆ You encounter a pride of lions playing poker. Do you join the game or fold? ๐Ÿคซ๐Ÿ”„ [Action: Play or Fold, Equipment: Poker Face]"],
151
- ["๐ŸŽ A tree filled with golden apples and a sign saying, 'Seriously, don't eat these!' What do you do? ๐Ÿค” [Action: Eat or Retreat, Equipment: Stomach Pump]"],
152
- ["๐ŸŒ• The moon turns red, wolves start howling, and your horoscope says 'Stay in bed.' Do you camp or go? ๐Ÿ•๏ธ๐Ÿšถ [Action: Camp or Scamp, Equipment: Astrology App]"],
153
- ["๐Ÿ’€ The final boss is an undead warrior selling life insurance. Do you combat or sign up? โš”๏ธ๐Ÿค [Action: Fight or Finance, Equipment: Policy Guide]"]
154
- ]
155
- )
156
- gr.HTML("""<h2>๐Ÿค– Mistral Chat - Gradio ๐Ÿค–</h2>
157
- In this demo, you can chat with <a href='https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1'>Mistral-7B-Instruct</a> model. ๐Ÿ’ฌ
158
- Learn more about the model <a href='https://huggingface.co/docs/transformers/main/model_doc/mistral'>here</a>. ๐Ÿ“š
159
- <h2>๐Ÿ›  Model Features ๐Ÿ› </h2>
160
- <ul>
161
- <li>๐ŸชŸ Sliding Window Attention with 128K tokens span</li>
162
- <li>๐Ÿš€ GQA for faster inference</li>
163
- <li>๐Ÿ“ Byte-fallback BPE tokenizer</li>
164
- </ul>
165
- <h3>๐Ÿ“œ License ๐Ÿ“œ Released under Apache 2.0 License</h3>
166
- <h3>๐Ÿ“ฆ Usage ๐Ÿ“ฆ</h3>
167
- <ul>
168
- <li>๐Ÿ“š Available on Huggingface Hub</li>
169
- <li>๐Ÿ Python code snippets for easy setup</li>
170
- <li>๐Ÿ“ˆ Expected speedups with Flash Attention 2</li>
171
- </ul>
172
- """)
173
  demo.queue().launch(debug=True)
 
93
 
94
  gr.ChatInterface(
95
  generate,
96
+ additional_inputs=additional_inputs,
97
+ examples = [
98
+ ["๐Ÿฐ Welcome to the Kingdom of Elandria! You are Jim and Tim, two bumbling bros with a knack for mischief. ๐Ÿคด๐Ÿคด [Action: Introduce yourselves, Equipment: Scepters of Foolishness]"],
99
+ ["๐ŸŒฒ You find yourselves in a forest filled with magical creatures and oddly specific 'Do Not Disturb' signs. ๐Ÿฆ„ [Action: Proceed cautiously, Equipment: Map of Social Etiquette]"],
100
+ ["๐Ÿป You stumble upon a dwarf tavern. They offer you 'Beard Beer.' Do you drink it? ๐Ÿบ [Action: Chug or Pass, Equipment: Empty Mugs]"],
101
+ ["๐Ÿ‰ A vegan dragon appears and chastises you for your leather boots. What do you do? ๐Ÿ—ก๏ธ๐Ÿƒ [Action: Apologize and offer kale, Equipment: Non-leather sandals]"],
102
+ ["๐Ÿ’Ž You find a treasure chest labeled 'Not a Mimic.' Seems legit. Do you open it? ๐Ÿ—๏ธ [Action: Open or No way, Equipment: Mimic Repellent]"],
103
+ ["๐Ÿฆ‡ You're swarmed by bats in a cave. One bat offers you 'organic guano.' How do you react? ๐Ÿ•ฏ๏ธ [Action: Politely decline, Equipment: Nose Plugs]"],
104
+ ["๐Ÿ”ฎ A mysterious sorcerer offers you a 'Love Potion No. 9ยฝ.' Do you take a sip? ๐Ÿถ [Action: Sip or Skip, Equipment: Breath Mints]"],
105
+ ["โš”๏ธ Bandits demand gold, but they accept credit cards. What's your move? ๐Ÿ’ฐ [Action: Pay or Pray, Equipment: Wallets]"],
106
+ ["๐Ÿšช A door with three locks and a sign saying 'Beware of the Dog.' Do you search for the keys or try to pet the dog? ๐Ÿ—๏ธ๐Ÿ’ช [Action: Unlock or Pet, Equipment: Dog Treats]"],
107
+ ["๐ŸŒŠ A river blocks your path. A mermaid offers to carry you across for a 'small' fee. ๐ŸŠโ€โ™€๏ธ๐ŸŒ‰ [Action: Accept or Decline, Equipment: Bargaining Skills]"],
108
+ ["๐Ÿฆ You encounter a pride of lions playing poker. Do you join the game or fold? ๐Ÿคซ๐Ÿ”„ [Action: Play or Fold, Equipment: Poker Face]"],
109
+ ["๐ŸŽ A tree filled with golden apples and a sign saying, 'Seriously, don't eat these!' What do you do? ๐Ÿค” [Action: Eat or Retreat, Equipment: Stomach Pump]"],
110
+ ["๐ŸŒ• The moon turns red, wolves start howling, and your horoscope says 'Stay in bed.' Do you camp or go? ๐Ÿ•๏ธ๐Ÿšถ [Action: Camp or Scamp, Equipment: Astrology App]"],
111
+ ["๐Ÿ’€ The final boss is an undead warrior selling life insurance. Do you combat or sign up? โš”๏ธ๐Ÿค [Action: Fight or Finance, Equipment: Policy Guide]"]
112
+ ]
113
+ )
114
+ gr.HTML("""<h2>๐Ÿค– Mistral Chat - Gradio ๐Ÿค–</h2>
115
+ In this demo, you can chat with <a href='https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1'>Mistral-7B-Instruct</a> model. ๐Ÿ’ฌ
116
+ Learn more about the model <a href='https://huggingface.co/docs/transformers/main/model_doc/mistral'>here</a>. ๐Ÿ“š
117
+ <h2>๐Ÿ›  Model Features ๐Ÿ› </h2>
118
+ <ul>
119
+ <li>๐ŸชŸ Sliding Window Attention with 128K tokens span</li>
120
+ <li>๐Ÿš€ GQA for faster inference</li>
121
+ <li>๐Ÿ“ Byte-fallback BPE tokenizer</li>
122
+ </ul>
123
+ <h3>๐Ÿ“œ License ๐Ÿ“œ Released under Apache 2.0 License</h3>
124
+ <h3>๐Ÿ“ฆ Usage ๐Ÿ“ฆ</h3>
125
+ <ul>
126
+ <li>๐Ÿ“š Available on Huggingface Hub</li>
127
+ <li>๐Ÿ Python code snippets for easy setup</li>
128
+ <li>๐Ÿ“ˆ Expected speedups with Flash Attention 2</li>
129
+ </ul>
130
+ """)
131
+
132
+ markdown="""
133
  | Feature | Description | Byline |
134
  |---------|-------------|--------|
135
  | ๐ŸชŸ Sliding Window Attention with 128K tokens span | Enables the model to have a larger context for each token. | Increases model's understanding of context, resulting in more coherent and contextually relevant outputs. |
 
166
 
167
  - ๐Ÿ“ˆ Expected speedups with Flash Attention 2
168
  - **Byline**: Keep an eye out for this update to benefit from performance gains.
 
169
  """
170
+ gr.Markdown(markdown)
171
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  demo.queue().launch(debug=True)