Spaces:
Sleeping
Sleeping
RashiAgarwal
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
|
|
5 |
|
6 |
model_name = "microsoft/phi-2"
|
7 |
model = AutoModelForCausalLM.from_pretrained(
|
8 |
-
model_name,
|
9 |
trust_remote_code=True
|
10 |
)
|
11 |
model.config.use_cache = False
|
@@ -26,7 +26,7 @@ def inference(prompt):
|
|
26 |
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
27 |
return result[0]['generated_text']
|
28 |
|
29 |
-
INTERFACE = gr.Interface(fn=inference, inputs=[gr.Textbox(label= "Prompt", value= '
|
30 |
|
31 |
outputs=gr.Text(label= "Generated Text"), title="Language Model Phi-2 fine-tuned with OpenAssistant/oasst-1 dataset using QLoRA strategy",
|
32 |
|
|
|
5 |
|
6 |
model_name = "microsoft/phi-2"
|
7 |
model = AutoModelForCausalLM.from_pretrained(
|
8 |
+
model_name, low_cpu_mem_usage=True,
|
9 |
trust_remote_code=True
|
10 |
)
|
11 |
model.config.use_cache = False
|
|
|
26 |
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
27 |
return result[0]['generated_text']
|
28 |
|
29 |
+
INTERFACE = gr.Interface(fn=inference, inputs=[gr.Textbox(label= "Prompt", value= 'write a note on Shakuntala Devi')],
|
30 |
|
31 |
outputs=gr.Text(label= "Generated Text"), title="Language Model Phi-2 fine-tuned with OpenAssistant/oasst-1 dataset using QLoRA strategy",
|
32 |
|