arad1367 commited on
Commit
b8be730
β€’
1 Parent(s): 2165a2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -4,11 +4,15 @@ import gradio as gr
4
  from groq import Groq
5
  import base64
6
  import os
 
7
 
8
  # Define models used in the process
9
  llava_model = 'llava-v1.5-7b-4096-preview'
10
  llama31_model = 'llama-3.1-70b-versatile'
11
 
 
 
 
12
  # Image encoding function
13
  def encode_image(image_path):
14
  with open(image_path, "rb") as image_file:
 
4
  from groq import Groq
5
  import base64
6
  import os
7
+ import subprocess
8
 
9
  # Define models used in the process
10
  llava_model = 'llava-v1.5-7b-4096-preview'
11
  llama31_model = 'llama-3.1-70b-versatile'
12
 
13
+ # Install flash-attn if not already installed
14
+ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
15
+
16
  # Image encoding function
17
  def encode_image(image_path):
18
  with open(image_path, "rb") as image_file: