Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,14 @@ import gradio as gr
|
|
| 4 |
client = InferenceClient("grammarly/coedit-large")
|
| 5 |
|
| 6 |
def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, top_k=50, repetition_penalty=1.0):
|
| 7 |
-
temperature
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
if temperature < 1e-2: temperature = 1e-2
|
| 9 |
top_p = float(top_p)
|
| 10 |
top_k = int(top_k) # Ensure top_k is an integer, as it was being treated like a float
|
|
|
|
| 4 |
client = InferenceClient("grammarly/coedit-large")
|
| 5 |
|
| 6 |
def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, top_k=50, repetition_penalty=1.0):
|
| 7 |
+
print(f" TEMP: {temperature} \n\t TYPE: {type(temperature)}")
|
| 8 |
+
print(f" TOP-P: {top_p} \n\t TYPE: {type(top_p)}")
|
| 9 |
+
print(f" TOP-K: {top_k} \n\t TYPE: {type(top_k)}")
|
| 10 |
+
print(f" MAX_TOK: {max_new_tokens} \n\t TYPE: {type(max_new_tokens)}")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
#temperature = float(temperature)
|
| 14 |
+
temperature = float(temperature[0]) if isinstance(temperature, list) else float(temperature)
|
| 15 |
if temperature < 1e-2: temperature = 1e-2
|
| 16 |
top_p = float(top_p)
|
| 17 |
top_k = int(top_k) # Ensure top_k is an integer, as it was being treated like a float
|