Delete model/inference.py
Browse files- model/inference.py +0 -12
model/inference.py
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
from transformers import LlamaForVision, LlamaProcessor
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
class ChartAnalyzer:
|
| 5 |
-
def __init__(self):
|
| 6 |
-
self.model = LlamaForVision.from_pretrained("your-model-path")
|
| 7 |
-
self.processor = LlamaProcessor.from_pretrained("your-model-path")
|
| 8 |
-
|
| 9 |
-
def analyze_chart(self, image):
|
| 10 |
-
inputs = self.processor(images=image, return_tensors="pt")
|
| 11 |
-
outputs = self.model.generate(**inputs)
|
| 12 |
-
return self.processor.decode(outputs[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|