Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|