Spaces:
Runtime error
Runtime error
Commit
·
f309e2f
1
Parent(s):
e042374
Update the front end
Browse files
app.py
CHANGED
@@ -7,6 +7,12 @@ import requests
|
|
7 |
title = "A conversation with Gandalf (GPTJ-6B) 🧙"
|
8 |
description = ""
|
9 |
article = """
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
<img src='http://www.simoninithomas.com/test/gandalf.jpg', alt="Gandalf"/>"""
|
11 |
theme="huggingface"
|
12 |
examples = [[0.9, 1.1, 50, "Hey Gandalf! How are you?"], [0.9, 1.1, 50, "Hey Gandalf, why you didn't use the great eagles to fly Frodo to Mordor?"]]
|
@@ -39,7 +45,7 @@ def clean_chat_output(txt, prompt):
|
|
39 |
return output
|
40 |
|
41 |
|
42 |
-
def chat(top_p,
|
43 |
history = gr.get_state() or []
|
44 |
history.append((message, ""))
|
45 |
gr.set_state(history)
|
|
|
7 |
title = "A conversation with Gandalf (GPTJ-6B) 🧙"
|
8 |
description = ""
|
9 |
article = """
|
10 |
+
<p> To reset you need to reload the page </p>
|
11 |
+
<h2> Parameters: </h2>
|
12 |
+
<ul>
|
13 |
+
<li>temperature: (sampling temperature) higher values means the model will take more risks.</li>
|
14 |
+
<li>max_new_tokens: Max number of tokens in generation.</li>
|
15 |
+
</ul>
|
16 |
<img src='http://www.simoninithomas.com/test/gandalf.jpg', alt="Gandalf"/>"""
|
17 |
theme="huggingface"
|
18 |
examples = [[0.9, 1.1, 50, "Hey Gandalf! How are you?"], [0.9, 1.1, 50, "Hey Gandalf, why you didn't use the great eagles to fly Frodo to Mordor?"]]
|
|
|
45 |
return output
|
46 |
|
47 |
|
48 |
+
def chat(top_p, max_new_tokens, message):
|
49 |
history = gr.get_state() or []
|
50 |
history.append((message, ""))
|
51 |
gr.set_state(history)
|