Spaces:
Runtime error
Runtime error
Commit
·
90c8b35
1
Parent(s):
29752d3
fix: port
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ import gradio as gr
|
|
| 9 |
|
| 10 |
def main(
|
| 11 |
base_model="ise-uiuc/Magicoder-S-DS-6.7B",
|
| 12 |
-
device="
|
| 13 |
-
port=
|
| 14 |
):
|
| 15 |
pipeline = transformers.pipeline(
|
| 16 |
"text-generation", model=base_model, torch_dtype=torch.bfloat16, device=device
|
|
@@ -19,7 +19,7 @@ def main(
|
|
| 19 |
def evaluate_magicoder(
|
| 20 |
instruction,
|
| 21 |
temperature=1,
|
| 22 |
-
max_length=
|
| 23 |
):
|
| 24 |
MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
|
| 25 |
|
|
@@ -56,7 +56,7 @@ def main(
|
|
| 56 |
),
|
| 57 |
gr.components.Slider(minimum=0, maximum=1, value=0, label="Temperature"),
|
| 58 |
gr.components.Slider(
|
| 59 |
-
minimum=1, maximum=
|
| 60 |
),
|
| 61 |
],
|
| 62 |
outputs=[
|
|
|
|
| 9 |
|
| 10 |
def main(
|
| 11 |
base_model="ise-uiuc/Magicoder-S-DS-6.7B",
|
| 12 |
+
#device="cuda",
|
| 13 |
+
port=80,
|
| 14 |
):
|
| 15 |
pipeline = transformers.pipeline(
|
| 16 |
"text-generation", model=base_model, torch_dtype=torch.bfloat16, device=device
|
|
|
|
| 19 |
def evaluate_magicoder(
|
| 20 |
instruction,
|
| 21 |
temperature=1,
|
| 22 |
+
max_length=4096,
|
| 23 |
):
|
| 24 |
MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
|
| 25 |
|
|
|
|
| 56 |
),
|
| 57 |
gr.components.Slider(minimum=0, maximum=1, value=0, label="Temperature"),
|
| 58 |
gr.components.Slider(
|
| 59 |
+
minimum=1, maximum=4096, step=1, value=1024, label="Max tokens"
|
| 60 |
),
|
| 61 |
],
|
| 62 |
outputs=[
|