stevhliu HF staff commited on
Commit
18d3078
·
verified ·
1 Parent(s): b4cb2d2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipeline = pipeline("text-generation", model="google/gemma-2-2b", torch_dtype=torch.bfloat16, device_map="auto", model_kwargs={"quantization_config": BitsAndBytesConfig(load_in_8bit=True)})
5
+ gr.Interface.from_pipeline(pipeline).launch()