Spaces:
No application file
No application file
Commit ·
ed2b885
1
Parent(s): 7130035
Update app.py
Browse files1 unmodified line23456783 unmodified lines121314151617181920212223242 unmodified lines2728293031323334353637123 unmodified lines1611621631641651661671 unmodified lineimport gradio as grfrom text_generation import Client, InferenceAPIClientopenchat_preprompt = ("\n<human>: Hi!\n<bot>: My name is multivac, model version is 0.15, part of an open-source kit for "3 unmodified lines)def get_client(model: str):if model == "Rallio67/joi2_20Be_instruct_alpha":return Client(os.getenv("JOI_API_URL"))if model == "togethercomputer/GPT-NeoXT-Chat-Base-20B":return Client(os.getenv("OPENCHAT_API_URL"))return InferenceAPIClient(model, token=os.getenv("HF_TOKEN", None))def get_usernames(model: str):"""2 unmodified lines"""if model == "OpenAssistant/oasst-sft-1-pythia-12b":return "", "<|prompter|>", "<|assistant|>", "<|endoftext|>"if model == "Rallio67/joi2_20Be_instruct_alpha":return "", "User: ", "Joi: ", "\n\n"if model == "togethercomputer/GPT-NeoXT-Chat-Base-20B":return openchat_preprompt, "<human>: ", "<bot>: ", "\n"return "", "User: ", "Assistant: ", "\n"def predict(123 unmodified lines)title = """<h1 align="center">🔥Large Language Model API 🚀Streaming🚀</h1>"""description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:```User: <utterance>1 unmodified line23456783 unmodified lines1213141516172 unmodified lines20212223242526123 unmodified lines1501511521531541551561 unmodified lineimport gradio as grgr.Interface.load("models/OpenAssistant/oasst-sft-1-pythia-12b").launch()openchat_preprompt = ("\n<human>: Hi!\n<bot>: My name is multivac, model version is 0.15, part of an open-source kit for "3 unmodified lines)def get_usernames(model: str):"""2 unmodified lines"""if model == "OpenAssistant/oasst-sft-1-pythia-12b":return "", "<|prompter|>", "<|assistant|>", "<|endoftext|>"def predict(123 unmodified lines)title = """<h1 align="center">🔥SAPIENS-IA🚀</h1>"""description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:```User: <utterance>
app.py+3-14