Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1589,6 +1589,9 @@ def maybe_upload_batch_set(pred_json_path):
|
|
1589 |
print(f'Failed to save to repo: {DATA_SET_REPO_PATH}|{str(e)}')
|
1590 |
|
1591 |
|
|
|
|
|
|
|
1592 |
def batch_inference(
|
1593 |
files: Union[str, List[str]],
|
1594 |
prompt_mode: str,
|
@@ -1633,9 +1636,10 @@ def batch_inference(
|
|
1633 |
prompt_format_fn = chatml_format
|
1634 |
elif prompt_mode == 'few-shot':
|
1635 |
from functools import partial
|
1636 |
-
prompt_format_fn = partial(
|
1637 |
-
|
1638 |
-
)
|
|
|
1639 |
else:
|
1640 |
raise gr.Error(f'Wrong mode {prompt_mode}')
|
1641 |
|
@@ -1923,10 +1927,10 @@ def launch():
|
|
1923 |
demo.launch(server_port=PORT, show_api=False, allowed_paths=["seal_logo.png"])
|
1924 |
|
1925 |
|
1926 |
-
def main():
|
1927 |
|
1928 |
-
|
1929 |
|
1930 |
|
1931 |
if __name__ == "__main__":
|
1932 |
-
|
|
|
1589 |
print(f'Failed to save to repo: {DATA_SET_REPO_PATH}|{str(e)}')
|
1590 |
|
1591 |
|
1592 |
+
def free_form_prompt(prompt, history=None, system_prompt=None):
|
1593 |
+
return prompt
|
1594 |
+
|
1595 |
def batch_inference(
|
1596 |
files: Union[str, List[str]],
|
1597 |
prompt_mode: str,
|
|
|
1636 |
prompt_format_fn = chatml_format
|
1637 |
elif prompt_mode == 'few-shot':
|
1638 |
from functools import partial
|
1639 |
+
# prompt_format_fn = partial(
|
1640 |
+
# chatml_format, include_end_instruct=False
|
1641 |
+
# )
|
1642 |
+
prompt_format_fn = free_form_prompt
|
1643 |
else:
|
1644 |
raise gr.Error(f'Wrong mode {prompt_mode}')
|
1645 |
|
|
|
1927 |
demo.launch(server_port=PORT, show_api=False, allowed_paths=["seal_logo.png"])
|
1928 |
|
1929 |
|
1930 |
+
# def main():
|
1931 |
|
1932 |
+
# launch()
|
1933 |
|
1934 |
|
1935 |
if __name__ == "__main__":
|
1936 |
+
launch()
|