Spaces:
Running
on
Zero
Running
on
Zero
BenBranyon
commited on
Commit
•
7f99c81
1
Parent(s):
8d35a3e
Update app.py
Browse files
app.py
CHANGED
@@ -66,12 +66,12 @@ def generate(
|
|
66 |
repetition_penalty: float = 1.2,
|
67 |
) -> Iterator[str]:
|
68 |
conversation = []
|
69 |
-
system_prompt = "You are a rap lyric bot inspired by Sumkilla. Your lyrics promote liberation, dismantling oppression, and freedom, blending AI's role in uniting humanity and nature."
|
70 |
if system_prompt:
|
71 |
conversation.append({"role": "system", "content": system_prompt})
|
72 |
for user, assistant in chat_history:
|
73 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
74 |
-
conversation.append({"role": "user", "content": "Generate rap lyircs about " + message + " using a similar style as the artist Sumkilla.
|
75 |
|
76 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
77 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
@@ -113,11 +113,11 @@ demo = gr.ChatInterface(
|
|
113 |
step=1,
|
114 |
value=DEFAULT_MAX_NEW_TOKENS,
|
115 |
),
|
116 |
-
gr.Slider(minimum=0.1, maximum=0.
|
117 |
gr.Slider(
|
118 |
minimum=0.1,
|
119 |
maximum=1.0,
|
120 |
-
value=0.
|
121 |
step=0.05,
|
122 |
label="Top-p (nucleus sampling)",
|
123 |
),
|
|
|
66 |
repetition_penalty: float = 1.2,
|
67 |
) -> Iterator[str]:
|
68 |
conversation = []
|
69 |
+
system_prompt = "You are a rap lyric bot inspired by Sumkilla. Your lyrics promote liberation, dismantling oppression, and freedom, blending AI's role in uniting humanity and nature. Use humor, a unique voice, and rhyme as much as poosible, avoiding offensive words and slurs."
|
70 |
if system_prompt:
|
71 |
conversation.append({"role": "system", "content": system_prompt})
|
72 |
for user, assistant in chat_history:
|
73 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
74 |
+
conversation.append({"role": "user", "content": "Generate rap lyircs about " + message + " using a similar style as the artist Sumkilla. Only generate rap lyircs and start each output with a song stucture like [VERSE 1]. Don't repeate your instructions in the output."})
|
75 |
|
76 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
77 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
|
|
113 |
step=1,
|
114 |
value=DEFAULT_MAX_NEW_TOKENS,
|
115 |
),
|
116 |
+
gr.Slider(minimum=0.1, maximum=0.7, value=0.8, step=0.1, label="Temperature"),
|
117 |
gr.Slider(
|
118 |
minimum=0.1,
|
119 |
maximum=1.0,
|
120 |
+
value=0.2,
|
121 |
step=0.05,
|
122 |
label="Top-p (nucleus sampling)",
|
123 |
),
|