Spaces:
Runtime error
Runtime error
Moritz Stephan
commited on
Commit
·
34bd714
1
Parent(s):
a7154cb
adding other methods to demo
Browse files
app.py
CHANGED
@@ -20,11 +20,12 @@ def get_feedback_options() -> List[Tuple[str, str]]:
|
|
20 |
for adapter in data]
|
21 |
|
22 |
|
23 |
-
def get_completion(_, prompt: str, adapter: Optional[str],
|
24 |
args = {
|
25 |
"C3PO_API_KEY": os.environ.get("C3PO_API_KEY"),
|
26 |
"prompt": prompt,
|
27 |
-
"adapter": adapter if
|
|
|
28 |
}
|
29 |
response = requests.post(f"{ENDPOINT_URL}/completion", json=args)
|
30 |
data = response.json()
|
@@ -62,8 +63,16 @@ demo = gr.Interface(
|
|
62 |
choices=dropdown_options, label="Feedback", info="Will add the adapter for the respective feedback to the model.",
|
63 |
value=dropdown_options[0][1]
|
64 |
),
|
65 |
-
gr.
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
)
|
68 |
],
|
69 |
"text",
|
|
|
20 |
for adapter in data]
|
21 |
|
22 |
|
23 |
+
def get_completion(_, prompt: str, adapter: Optional[str], method: str) -> str:
|
24 |
args = {
|
25 |
"C3PO_API_KEY": os.environ.get("C3PO_API_KEY"),
|
26 |
"prompt": prompt,
|
27 |
+
"adapter": adapter if method != "none" else None,
|
28 |
+
"method": method if method != "none" else None,
|
29 |
}
|
30 |
response = requests.post(f"{ENDPOINT_URL}/completion", json=args)
|
31 |
data = response.json()
|
|
|
63 |
choices=dropdown_options, label="Feedback", info="Will add the adapter for the respective feedback to the model.",
|
64 |
value=dropdown_options[0][1]
|
65 |
),
|
66 |
+
gr.Radio(
|
67 |
+
choices=[
|
68 |
+
("C3PO", "c3po"),
|
69 |
+
("DPO", "dpo"),
|
70 |
+
("SFT + Negatives", "sft_negatives"),
|
71 |
+
("SFT", "sft"),
|
72 |
+
("Baseline", "baseline")
|
73 |
+
],
|
74 |
+
value="c3po",
|
75 |
+
label="Select which method to use. 'Baseline' is the Mistal-instruct-v0.2 model without any adapter.",
|
76 |
)
|
77 |
],
|
78 |
"text",
|