Spaces:
Runtime error
Runtime error
Commit ·
5d7db0a
1
Parent(s): 184b5fd
Use sampling.
Browse files
app.py
CHANGED
|
@@ -17,11 +17,12 @@ def query(payload):
|
|
| 17 |
def inference(input_sentence, max_length, seed=42):
|
| 18 |
parameters = {
|
| 19 |
'max_new_tokens': max_length,
|
| 20 |
-
'
|
| 21 |
-
'
|
| 22 |
-
'early_stopping': True,
|
| 23 |
-
'eos_token_id': None,
|
| 24 |
'seed': seed,
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
payload = {
|
|
@@ -40,10 +41,6 @@ def inference(input_sentence, max_length, seed=42):
|
|
| 40 |
|
| 41 |
st.title('Chilton')
|
| 42 |
|
| 43 |
-
input = st.text_input('Como sua música começa?
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
output = inference(input, 50)
|
| 47 |
-
st.write(output)
|
| 48 |
-
else:
|
| 49 |
-
st.write('Escreva um verso maior.')
|
|
|
|
| 17 |
def inference(input_sentence, max_length, seed=42):
|
| 18 |
parameters = {
|
| 19 |
'max_new_tokens': max_length,
|
| 20 |
+
'top_p': 0.9,
|
| 21 |
+
'do_sample': True,
|
|
|
|
|
|
|
| 22 |
'seed': seed,
|
| 23 |
+
'early_stopping': False,
|
| 24 |
+
'length_penalty': 0.0,
|
| 25 |
+
'eos_token_id': None,
|
| 26 |
}
|
| 27 |
|
| 28 |
payload = {
|
|
|
|
| 41 |
|
| 42 |
st.title('Chilton')
|
| 43 |
|
| 44 |
+
input = st.text_input('Como sua música começa?')
|
| 45 |
+
output = inference(input, 50)
|
| 46 |
+
st.caption(output)
|
|
|
|
|
|
|
|
|
|
|
|