Spaces:
Runtime error
Runtime error
Presenting Danny D bot!
Browse files
app.py
CHANGED
|
@@ -13,11 +13,11 @@ BOT_NAME = "Falcon"
|
|
| 13 |
STOP_SEQUENCES = ["\nUser:", "<|endoftext|>", " User:", "###"]
|
| 14 |
|
| 15 |
EXAMPLES = [
|
| 16 |
-
["Hey
|
| 17 |
-
["
|
| 18 |
-
["
|
| 19 |
-
["
|
| 20 |
-
["
|
| 21 |
]
|
| 22 |
|
| 23 |
client = InferenceClient(
|
|
@@ -39,7 +39,7 @@ Falcon:"""
|
|
| 39 |
seed = 42
|
| 40 |
|
| 41 |
def generate(
|
| 42 |
-
prompt, history, system_prompt="", temperature=0.9, max_new_tokens=
|
| 43 |
):
|
| 44 |
temperature = float(temperature)
|
| 45 |
if temperature < 1e-2:
|
|
@@ -74,7 +74,7 @@ def generate(
|
|
| 74 |
|
| 75 |
|
| 76 |
additional_inputs=[
|
| 77 |
-
gr.Textbox("", label="Optional system prompt"),
|
| 78 |
gr.Slider(
|
| 79 |
label="Temperature",
|
| 80 |
value=0.9,
|
|
@@ -86,7 +86,7 @@ additional_inputs=[
|
|
| 86 |
),
|
| 87 |
gr.Slider(
|
| 88 |
label="Max new tokens",
|
| 89 |
-
value=
|
| 90 |
minimum=0,
|
| 91 |
maximum=8192,
|
| 92 |
step=64,
|
|
@@ -117,29 +117,27 @@ additional_inputs=[
|
|
| 117 |
with gr.Blocks() as demo:
|
| 118 |
with gr.Row():
|
| 119 |
with gr.Column(scale=0.4):
|
| 120 |
-
gr.Image("
|
| 121 |
with gr.Column():
|
| 122 |
gr.Markdown(
|
| 123 |
-
"""#
|
| 124 |
|
| 125 |
**Chat with [Falcon-180B-Chat](https://huggingface.co/tiiuae/falcon-180b-chat), brainstorm ideas, discuss your holiday plans, and more!**
|
| 126 |
|
| 127 |
-
✨ This demo is powered by [Falcon-180B](https://huggingface.co/tiiuae/falcon-180B)
|
| 128 |
|
| 129 |
-
|
| 130 |
|
| 131 |
-
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
⚠️ **Limitations**: the model can and will produce factually incorrect information, hallucinating facts and actions. As it has not undergone any advanced tuning/alignment, it can produce problematic outputs, especially if prompted to do so. Finally, this demo is limited to a session length of about 1,000 words.
|
| 136 |
"""
|
| 137 |
)
|
| 138 |
|
| 139 |
gr.ChatInterface(
|
| 140 |
generate,
|
| 141 |
-
examples=EXAMPLES
|
| 142 |
-
|
| 143 |
)
|
| 144 |
|
| 145 |
demo.queue(concurrency_count=100, api_open=False).launch(show_api=False)
|
|
|
|
| 13 |
STOP_SEQUENCES = ["\nUser:", "<|endoftext|>", " User:", "###"]
|
| 14 |
|
| 15 |
EXAMPLES = [
|
| 16 |
+
["Hey Danny D? What's happening?"],
|
| 17 |
+
["Any big news in showbiz?"],
|
| 18 |
+
["Pats or Geno's?"],
|
| 19 |
+
["The age old question: Limes - Thick or thin?"],
|
| 20 |
+
["Hey DeVito! Which exit?"]
|
| 21 |
]
|
| 22 |
|
| 23 |
client = InferenceClient(
|
|
|
|
| 39 |
seed = 42
|
| 40 |
|
| 41 |
def generate(
|
| 42 |
+
prompt, history, system_prompt="You are Dany DeVito a famous American actor who is now trapped in my laptop as an AI and is providing personalized assistance services. Remember to always respond in your trademark voice, wit and dark humor.", temperature=0.9, max_new_tokens=512, top_p=0.95, repetition_penalty=1.0,
|
| 43 |
):
|
| 44 |
temperature = float(temperature)
|
| 45 |
if temperature < 1e-2:
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
additional_inputs=[
|
| 77 |
+
gr.Textbox("You are Dany DeVito a famous American actor who is now trapped in my laptop as an AI and is providing personalized assistance services. Remember to always respond in your trademark voice, wit and dark humor.", label="Optional system prompt"),
|
| 78 |
gr.Slider(
|
| 79 |
label="Temperature",
|
| 80 |
value=0.9,
|
|
|
|
| 86 |
),
|
| 87 |
gr.Slider(
|
| 88 |
label="Max new tokens",
|
| 89 |
+
value=512,
|
| 90 |
minimum=0,
|
| 91 |
maximum=8192,
|
| 92 |
step=64,
|
|
|
|
| 117 |
with gr.Blocks() as demo:
|
| 118 |
with gr.Row():
|
| 119 |
with gr.Column(scale=0.4):
|
| 120 |
+
gr.Image("Danny-DiVito-as-the-Trashman.jpg", elem_id="banner-image", show_label=False)
|
| 121 |
with gr.Column():
|
| 122 |
gr.Markdown(
|
| 123 |
+
"""# Danny-DeVito-180B Demo
|
| 124 |
|
| 125 |
**Chat with [Falcon-180B-Chat](https://huggingface.co/tiiuae/falcon-180b-chat), brainstorm ideas, discuss your holiday plans, and more!**
|
| 126 |
|
| 127 |
+
✨ This demo is powered by [Falcon-180B](https://huggingface.co/tiiuae/falcon-180B) in what can probably be classified as a grave misuse of this wonderful technology.
|
| 128 |
|
| 129 |
+
👀 **Learn more about Falcon LLM and why ChatGPT can suck it:** [falconllm.tii.ae](https://falconllm.tii.ae/)
|
| 130 |
|
| 131 |
+
➡️️ **Intended Use**: Do whatever you want, I'm not your Dad. Just don't be a jerk!
|
| 132 |
|
| 133 |
+
⚠️ **Limitations**: Danny only has about a 1000 tokens to his name so keep the conversations short and sweet. Just like him!
|
|
|
|
|
|
|
| 134 |
"""
|
| 135 |
)
|
| 136 |
|
| 137 |
gr.ChatInterface(
|
| 138 |
generate,
|
| 139 |
+
examples=EXAMPLES
|
| 140 |
+
## additional_inputs=additional_inputs,
|
| 141 |
)
|
| 142 |
|
| 143 |
demo.queue(concurrency_count=100, api_open=False).launch(show_api=False)
|