far555na commited on
Commit
0f51357
1 Parent(s): b78b8e7

Update ig.py

Browse files
Files changed (1) hide show
  1. ig.py +2 -5
ig.py CHANGED
@@ -1,14 +1,11 @@
1
  from transformers import AutoProcessor, AutoModelForCausalLM
2
  import gradio as gr
3
  import torch
4
- from transformers import AutoAdapterModel, AutoTokenizer
5
 
6
  model_name = "./"
7
- model = AutoAdapterModel.from_pretrained(model_name)
8
- tokenizer = AutoTokenizer.from_pretrained(model_name)
9
  processor = AutoProcessor.from_pretrained("microsoft/git-base")
10
 
11
-
12
  def predict(image):
13
  try:
14
  # Prepare the image using the processor
@@ -45,4 +42,4 @@ with gr.Blocks() as demo:
45
  if __name__ == "__main__":
46
  demo.launch() # Local machine only
47
  # demo.launch(server_name="0.0.0.0") # LAN access to local machine
48
- # demo.launch(share=True) # Public access to local machine
 
1
  from transformers import AutoProcessor, AutoModelForCausalLM
2
  import gradio as gr
3
  import torch
 
4
 
5
  model_name = "./"
6
+ model = AutoModelForCausalLM.from_pretrained(model_name)
 
7
  processor = AutoProcessor.from_pretrained("microsoft/git-base")
8
 
 
9
  def predict(image):
10
  try:
11
  # Prepare the image using the processor
 
42
  if __name__ == "__main__":
43
  demo.launch() # Local machine only
44
  # demo.launch(server_name="0.0.0.0") # LAN access to local machine
45
+ # demo.launch(share=True) # Public access to local machine