andito HF staff commited on
Commit
c80b72d
·
1 Parent(s): ecd7421

pass model in the hub

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,13 +1,16 @@
1
  import gradio as gr
2
  from threading import Thread
3
  from PIL import Image
4
- import spaces
5
  import moondream as md
6
- #import subprocess
7
- #subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
8
 
 
 
 
 
 
9
 
10
- model = md.vl(model="moondream-0_5b-int8.mf")
11
 
12
  def model_inference(input_dict, history):
13
  # Extract image from message if present
 
1
  import gradio as gr
2
  from threading import Thread
3
  from PIL import Image
 
4
  import moondream as md
5
+ from huggingface_hub import hf_hub_download
 
6
 
7
+ # Download model at runtime
8
+ model_path = hf_hub_download(
9
+ repo_id="andito/moondream05",
10
+ filename="moondream-0_5b-int8.mf",
11
+ )
12
 
13
+ model = md.vl(model=model_path)
14
 
15
  def model_inference(input_dict, history):
16
  # Extract image from message if present