ming commited on
Commit
6b859f2
·
1 Parent(s): 441f66b

Fix Python 3.10 requirement and torch_dtype deprecation

Browse files

- Update Dockerfile to Python 3.10 (Outlines requires 3.10+)
- Replace deprecated torch_dtype with dtype parameter
- Fixes TypeError with Outlines library on Python 3.9

Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # Hugging Face Spaces compatible Dockerfile - V4 GPU INT4
2
- FROM python:3.9-slim
3
 
4
  # Set environment variables for V4 GPU deployment
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
 
1
  # Hugging Face Spaces compatible Dockerfile - V4 GPU INT4
2
+ FROM python:3.10-slim
3
 
4
  # Set environment variables for V4 GPU deployment
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
app/services/structured_summarizer.py CHANGED
@@ -139,7 +139,7 @@ class StructuredSummarizer:
139
  logger.info("Loading V4 model in FP16 for maximum speed (2-3x faster than 4-bit)...")
140
  self.model = AutoModelForCausalLM.from_pretrained(
141
  settings.v4_model_id,
142
- torch_dtype=torch.float16,
143
  device_map="auto",
144
  cache_dir=settings.hf_cache_dir,
145
  trust_remote_code=True,
@@ -160,7 +160,7 @@ class StructuredSummarizer:
160
 
161
  self.model = AutoModelForCausalLM.from_pretrained(
162
  settings.v4_model_id,
163
- torch_dtype=base_dtype,
164
  device_map="auto" if use_cuda else None,
165
  cache_dir=settings.hf_cache_dir,
166
  trust_remote_code=True,
 
139
  logger.info("Loading V4 model in FP16 for maximum speed (2-3x faster than 4-bit)...")
140
  self.model = AutoModelForCausalLM.from_pretrained(
141
  settings.v4_model_id,
142
+ dtype=torch.float16,
143
  device_map="auto",
144
  cache_dir=settings.hf_cache_dir,
145
  trust_remote_code=True,
 
160
 
161
  self.model = AutoModelForCausalLM.from_pretrained(
162
  settings.v4_model_id,
163
+ dtype=base_dtype,
164
  device_map="auto" if use_cuda else None,
165
  cache_dir=settings.hf_cache_dir,
166
  trust_remote_code=True,