AhmadT198 commited on
Commit
0a6540b
1 Parent(s): b7899e7

Trying to empty cache and load the model once

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,13 +7,15 @@ import torch
7
  # Use a pipeline as a high-level helper
8
  from transformers import pipeline
9
 
 
10
 
 
 
 
11
 
12
  @spaces.GPU(duration=120)
13
  def llama3_1_8B(question):
14
- print("RUNNING PIPE")
15
- pipe = pipeline("text-generation", model="NousResearch/Hermes-3-Llama-3.1-8B", max_new_tokens=200, device=0)
16
- print("PIPE DONE")
17
 
18
  messages = [
19
  {"role": "user", "content": question},
 
7
  # Use a pipeline as a high-level helper
8
  from transformers import pipeline
9
 
10
+ torch.cuda.empty_cache()
11
 
12
+ print("RUNNING PIPE")
13
+ pipe = pipeline("text-generation", model="NousResearch/Hermes-3-Llama-3.1-8B", max_new_tokens=200, device=0)
14
+ print("PIPE DONE")
15
 
16
  @spaces.GPU(duration=120)
17
  def llama3_1_8B(question):
18
+
 
 
19
 
20
  messages = [
21
  {"role": "user", "content": question},