Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,23 +15,13 @@ if hf_api_token is None:
|
|
15 |
login(token=hf_api_token, add_to_git_credential=True)
|
16 |
|
17 |
|
18 |
-
# Define the local directory where the model will be saved
|
19 |
-
local_model_dir = "meta-llama/Llama-2-7b-chat"
|
20 |
-
|
21 |
-
# Create the directory if it doesn't exist
|
22 |
-
os.makedirs(local_model_dir, exist_ok=True)
|
23 |
-
|
24 |
-
# Download the model and tokenizer
|
25 |
-
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat", cache_dir=local_model_dir)
|
26 |
-
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat", cache_dir=local_model_dir)
|
27 |
-
|
28 |
# Initialize the Whisper processor and model
|
29 |
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-base")
|
30 |
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
|
31 |
|
32 |
# Initialize the summarization model and tokenizer
|
33 |
# Load LLAMA 7B model with accelerate from local path
|
34 |
-
model_name = "
|
35 |
with init_empty_weights():
|
36 |
summarization_model = AutoModelForCausalLM.from_pretrained(model_name)
|
37 |
|
|
|
15 |
login(token=hf_api_token, add_to_git_credential=True)
|
16 |
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Initialize the Whisper processor and model
|
19 |
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-base")
|
20 |
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
|
21 |
|
22 |
# Initialize the summarization model and tokenizer
|
23 |
# Load LLAMA 7B model with accelerate from local path
|
24 |
+
model_name = "meta-llama/Llama-2-7b-chat"
|
25 |
with init_empty_weights():
|
26 |
summarization_model = AutoModelForCausalLM.from_pretrained(model_name)
|
27 |
|