Jagad1234unique commited on
Commit
54a68cf
·
verified ·
1 Parent(s): e06e32d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,12 +1,17 @@
1
  import gradio as gr
 
 
 
 
2
 
3
  """
4
  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
5
  """
6
  # Load model directly
7
- from transformers import AutoModel
8
- model = AutoModel.from_pretrained("Jagad1234unique/Uni_stu")
9
 
 
 
10
 
11
  def respond(
12
  message,
 
1
  import gradio as gr
2
+ # Use a pipeline as a high-level helper
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("text-generation", model="tiiuae/falcon-40b", trust_remote_code=True)
6
 
7
  """
8
  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
9
  """
10
  # Load model directly
11
+ from transformers import AutoTokenizer, AutoModelForCausalLM
 
12
 
13
+ tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b", trust_remote_code=True)
14
+ model = AutoModelForCausalLM.from_pretrained("tiiuae/falcon-40b", trust_remote_code=True)
15
 
16
  def respond(
17
  message,