Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,10 +30,11 @@ def get_types(cls_set: List[Type], component: str):
|
|
| 30 |
routes.get_types = get_types
|
| 31 |
|
| 32 |
def cut(prom, out):
|
| 33 |
-
output = out[len(prom)-
|
| 34 |
output = output.split('<|endoftext|>')[0]
|
| 35 |
output = output.split('\n')[0]
|
| 36 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
|
|
|
| 37 |
return output
|
| 38 |
# App code
|
| 39 |
def mbti(x):
|
|
@@ -48,12 +49,13 @@ def mbti(x):
|
|
| 48 |
return r
|
| 49 |
|
| 50 |
def chat(x):
|
|
|
|
| 51 |
result = gradio_client.predict(
|
| 52 |
x,# str representing input in 'User input' Textbox component
|
| 53 |
0.91, # float, representing input in 'Top-p (nucleus sampling)' Slider component
|
| 54 |
50, # int, representing input in 'Top-k (nucleus sampling)' Slider component
|
| 55 |
0.8, # float, representing input in 'Temperature' Slider component
|
| 56 |
-
|
| 57 |
1.1, # float, representing input in 'repetition_penalty' Slider component
|
| 58 |
fn_index=0
|
| 59 |
)
|
|
|
|
| 30 |
routes.get_types = get_types
|
| 31 |
|
| 32 |
def cut(prom, out):
|
| 33 |
+
output = out[len(prom)-1:]
|
| 34 |
output = output.split('<|endoftext|>')[0]
|
| 35 |
output = output.split('\n')[0]
|
| 36 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
| 37 |
+
outout = output.replace("νν", "γ
γ
")
|
| 38 |
return output
|
| 39 |
# App code
|
| 40 |
def mbti(x):
|
|
|
|
| 49 |
return r
|
| 50 |
|
| 51 |
def chat(x):
|
| 52 |
+
x = f"[λλ μ§λ¬ΈνκΈ°λ₯Ό μ’μν΄. λλ κΈμ μ μ΄κ³ 곡κ°μ μνλ μ±κ²©μ΄μΌ. μ§κΈ λλ μΉκ΅¬μ λννκ³ μμ΄. λ¨κ³λ³λ‘ μκ°ν΄μ μμ°μ€λ½κ² λλ΅ν΄μ€.] {x}"
|
| 53 |
result = gradio_client.predict(
|
| 54 |
x,# str representing input in 'User input' Textbox component
|
| 55 |
0.91, # float, representing input in 'Top-p (nucleus sampling)' Slider component
|
| 56 |
50, # int, representing input in 'Top-k (nucleus sampling)' Slider component
|
| 57 |
0.8, # float, representing input in 'Temperature' Slider component
|
| 58 |
+
25, # int, representing input in 'Max New Tokens' Slider component
|
| 59 |
1.1, # float, representing input in 'repetition_penalty' Slider component
|
| 60 |
fn_index=0
|
| 61 |
)
|