Update app.py
Browse fileschange model to Phi 3
app.py
CHANGED
@@ -17,28 +17,15 @@ DEFAULT_MAX_NEW_TOKENS = 256
|
|
17 |
MAX_INPUT_TOKEN_LENGTH = 512
|
18 |
|
19 |
DESCRIPTION = """\
|
20 |
-
#
|
21 |
|
22 |
-
This Space demonstrates [
|
23 |
|
24 |
-
For additional detail on the model, including a link to the arXiv paper, refer to the [Hugging Face Paper page for
|
25 |
-
|
26 |
-
For details on pre-training, instruction tuning, and parameter-efficient finetuning for the model refer to the [OpenELM page in the CoreNet GitHub repository](https://github.com/apple/corenet/tree/main/projects/openelm) .
|
27 |
-
"""
|
28 |
-
|
29 |
-
LICENSE = """
|
30 |
-
<p/>
|
31 |
-
|
32 |
-
---
|
33 |
-
As a derivative work of [apple/OpenELM-270M-Instruct](https://huggingface.co/apple/OpenELM-270M-Instruct) by Apple,
|
34 |
-
this demo is governed by the original [license](https://huggingface.co/apple/OpenELM-270M-Instruct/blob/main/LICENSE)
|
35 |
-
|
36 |
-
Based on the [Norod78/OpenELM_3B_Demo](https://huggingface.co/spaces/Norod78/OpenELM_3B_Demo) space.
|
37 |
"""
|
38 |
|
39 |
-
|
40 |
model = AutoModelForCausalLM.from_pretrained(
|
41 |
-
"
|
42 |
trust_remote_code=True,
|
43 |
)
|
44 |
tokenizer = AutoTokenizer.from_pretrained(
|
@@ -149,7 +136,6 @@ chat_interface = gr.ChatInterface(
|
|
149 |
with gr.Blocks(css="style.css") as demo:
|
150 |
gr.Markdown(DESCRIPTION)
|
151 |
chat_interface.render()
|
152 |
-
gr.Markdown(LICENSE)
|
153 |
|
154 |
if __name__ == "__main__":
|
155 |
demo.queue(max_size=20).launch()
|
|
|
17 |
MAX_INPUT_TOKEN_LENGTH = 512
|
18 |
|
19 |
DESCRIPTION = """\
|
20 |
+
# Phi-3-mini-4k-instruct -- Running on CPU
|
21 |
|
22 |
+
This Space demonstrates [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) by Microsoft. Please, check the original model card for details.
|
23 |
|
24 |
+
For additional detail on the model, including a link to the arXiv paper, refer to the [Hugging Face Paper page for Phi 3](https://huggingface.co/papers/2404.14219) .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
"""
|
26 |
|
|
|
27 |
model = AutoModelForCausalLM.from_pretrained(
|
28 |
+
"microsoft/Phi-3-mini-4k-instruct",
|
29 |
trust_remote_code=True,
|
30 |
)
|
31 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
136 |
with gr.Blocks(css="style.css") as demo:
|
137 |
gr.Markdown(DESCRIPTION)
|
138 |
chat_interface.render()
|
|
|
139 |
|
140 |
if __name__ == "__main__":
|
141 |
demo.queue(max_size=20).launch()
|