dafajudin commited on
Commit
bb07b3d
1 Parent(s): 10988ef

update code

Browse files
Files changed (3) hide show
  1. app.py +8 -8
  2. img/idefics2_architecture.png +0 -0
  3. index.html +1 -1
app.py CHANGED
@@ -9,7 +9,7 @@ import torch
9
  from peft import LoraConfig
10
  from transformers import AutoProcessor, BitsAndBytesConfig, IdeficsForVisionText2Text
11
 
12
- # Baca konten HTML dari file index.html
13
  with open('index.html', encoding='utf-8') as file:
14
  html_content = file.read()
15
 
@@ -34,12 +34,12 @@ if USE_QLORA or USE_LORA:
34
  bnb_4bit_compute_dtype=torch.float16
35
  )
36
 
37
- # Model yang akan digunakan
38
- model = Idefics2ForConditionalGeneration.from_pretrained(
39
- "jihadzakki/idefics2-8b-vqarad-delta",
40
- torch_dtype=torch.float16,
41
- quantization_config=bnb_config
42
- )
43
 
44
  processor = AutoProcessor.from_pretrained(
45
  "HuggingFaceM4/idefics2-8b",
@@ -104,7 +104,7 @@ with gr.Blocks(
104
 
105
  with gr.Row():
106
  with gr.Column():
107
- image_input = gr.Image(label="Upload image", type="pil")
108
  with gr.Column():
109
  question_input = gr.Textbox(show_label=False, placeholder="Enter your question here...")
110
  with gr.Row():
 
9
  from peft import LoraConfig
10
  from transformers import AutoProcessor, BitsAndBytesConfig, IdeficsForVisionText2Text
11
 
12
+ # read from index.html
13
  with open('index.html', encoding='utf-8') as file:
14
  html_content = file.read()
15
 
 
34
  bnb_4bit_compute_dtype=torch.float16
35
  )
36
 
37
+ # Model Idefics2
38
+ # model = Idefics2ForConditionalGeneration.from_pretrained(
39
+ # "jihadzakki/idefics2-8b-vqarad-delta",
40
+ # torch_dtype=torch.float16,
41
+ # quantization_config=bnb_config
42
+ # )
43
 
44
  processor = AutoProcessor.from_pretrained(
45
  "HuggingFaceM4/idefics2-8b",
 
104
 
105
  with gr.Row():
106
  with gr.Column():
107
+ image_input = gr.Image(label="Image", type="pil")
108
  with gr.Column():
109
  question_input = gr.Textbox(show_label=False, placeholder="Enter your question here...")
110
  with gr.Row():
img/idefics2_architecture.png DELETED
Binary file (924 kB)
 
index.html CHANGED
@@ -120,7 +120,7 @@
120
  <h3 class="overview-heading"><span class="vl">Model Architecture</span></h3>
121
  <div>
122
  <p class="overview-content">The model is trained using Idefics2-8b.</p>
123
- <img class="content-image" src="img/idefics2_architecture.png" alt="model-architecture" />
124
  </div>
125
  </div>
126
  </section>
 
120
  <h3 class="overview-heading"><span class="vl">Model Architecture</span></h3>
121
  <div>
122
  <p class="overview-content">The model is trained using Idefics2-8b.</p>
123
+ <img class="content-image" src="https://raw.githubusercontent.com/Kalbe-x-Bangkit/C24-RM-Kalbe-Bangkit/main/img/idefics2_architecture.png" alt="model-architecture" />
124
  </div>
125
  </div>
126
  </section>