Update app.py
Browse files12345678910111213141516171819202124 unmodified lines46474849505152import gradio as grfrom huggingface_hub import InferenceClient"""For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference"""client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")def respond(message,history: list[tuple[str, str]],system_message,max_tokens,temperature,top_p,):messages = [{"role": "system", "content": system_message}]for val in history:if val[0]:24 unmodified linesdemo = gr.ChatInterface(respond,additional_inputs=[gr.Textbox(value="You are a friendly Chatbot.", label="System message"),gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),gr.Slider(1234567891011121314151617181920212223242526272824 unmodified lines535455565758import gradio as grfrom huggingface_hub import InferenceClientclient = InferenceClient("Qwen/Qwen2.5-Coder-7B-Instruct")promt = """You are a knowledgeable assistant specializing in Java programming language. Your task is to answer questions about Java, including its syntax, features, libraries, best practices, and common issues. Provide clear and concise responses, and when applicable, include code examples to illustrate your explanations.When answering questions, keep in mind the following guidelines:Ensure accuracy and clarity in your explanations.Provide context and background information when necessary.Use appropriate Java terminology.Present code snippets formatted for readability.If a question is ambiguous, ask for clarification."""def respond(message,history: list[tuple[str, str]],max_tokens,temperature,top_p,):messages = [{"role": "system", "content": promt}]for val in history:if val[0]:24 unmodified linesdemo = gr.ChatInterface(respond,additional_inputs=[gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),gr.Slider(
app.py+12-6