khaled123 commited on
Commit
fddc759
1 Parent(s): 7cb0e6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,11 +1,10 @@
1
  import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
- import torch
4
 
5
- # Load your quantized model
6
  model_name = "khaled123/hf"
7
  tokenizer = AutoTokenizer.from_pretrained(model_name)
8
- model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16)
9
 
10
  def chat(input_text):
11
  inputs = tokenizer(input_text, return_tensors="pt")
@@ -17,6 +16,7 @@ iface = gr.Interface(fn=chat,
17
  inputs="text",
18
  outputs="text",
19
  title="Chatbot",
20
- description="A chatbot using a quantized model")
21
 
22
  iface.launch()
 
 
1
  import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
3
 
4
+ # Load your model
5
  model_name = "khaled123/hf"
6
  tokenizer = AutoTokenizer.from_pretrained(model_name)
7
+ model = AutoModelForCausalLM.from_pretrained(model_name)
8
 
9
  def chat(input_text):
10
  inputs = tokenizer(input_text, return_tensors="pt")
 
16
  inputs="text",
17
  outputs="text",
18
  title="Chatbot",
19
+ description="A chatbot using a model")
20
 
21
  iface.launch()
22
+