Create pipeline.py
Browse files- pipeline.py +9 -0
pipeline.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
|
| 3 |
+
def get_pipeline():
|
| 4 |
+
return pipeline(
|
| 5 |
+
task="image-to-text",
|
| 6 |
+
model="Muizzzz8/phi3-prescription-reader",
|
| 7 |
+
trust_remote_code=True, # Required for custom models
|
| 8 |
+
device_map="auto" # Automatically uses GPU if available
|
| 9 |
+
)
|