Spaces:
Runtime error
Runtime error
Commit
β’
513e175
1
Parent(s):
fbcfd77
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,8 @@ article = """
|
|
10 |
<p> If you liked don't forget to π the project π₯° </p>
|
11 |
<h2> Parameters: </h2>
|
12 |
<ul>
|
|
|
|
|
13 |
<li><i>npc_prompt</i>: prompt of the NPC, we can modify it to see if results are better.</li>
|
14 |
<li><i>top_p</i>: control how deterministic the model is in generating a response.</li>
|
15 |
<li><i>temperature</i>: (sampling temperature) higher values means the model will take more risks.</li>
|
@@ -18,9 +20,9 @@ article = """
|
|
18 |
<img src='http://www.simoninithomas.com/test/gandalf.jpg', alt="Gandalf"/>"""
|
19 |
theme="huggingface"
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
# Builds the prompt from what previously happened
|
26 |
def build_prompt(conversation, context):
|
@@ -67,9 +69,6 @@ def chat(top_p, temperature, max_new_tokens, message):
|
|
67 |
return response, history
|
68 |
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
#io = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
74 |
|
75 |
iface = gr.Interface(fn=chat,
|
|
|
10 |
<p> If you liked don't forget to π the project π₯° </p>
|
11 |
<h2> Parameters: </h2>
|
12 |
<ul>
|
13 |
+
<li><i>message</i>: what you want to say to the NPC.</li>
|
14 |
+
<li><i>npc_name</i>: name of the NPC.</li>
|
15 |
<li><i>npc_prompt</i>: prompt of the NPC, we can modify it to see if results are better.</li>
|
16 |
<li><i>top_p</i>: control how deterministic the model is in generating a response.</li>
|
17 |
<li><i>temperature</i>: (sampling temperature) higher values means the model will take more risks.</li>
|
|
|
20 |
<img src='http://www.simoninithomas.com/test/gandalf.jpg', alt="Gandalf"/>"""
|
21 |
theme="huggingface"
|
22 |
|
23 |
+
context_setup = prompt
|
24 |
+
context = context_setup
|
25 |
+
interlocutor_names = ["Player", npc_name]
|
26 |
|
27 |
# Builds the prompt from what previously happened
|
28 |
def build_prompt(conversation, context):
|
|
|
69 |
return response, history
|
70 |
|
71 |
|
|
|
|
|
|
|
72 |
#io = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
73 |
|
74 |
iface = gr.Interface(fn=chat,
|