okeanos commited on
Commit
d7744cf
1 Parent(s): f08668e
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -8,21 +8,16 @@ import os
8
 
9
 
10
  # Initialize the model pipeline
11
- generator = pipeline('text-generation', model='hydra-project/ChatHercules-2.5-Mistral-7B', torch_dtype=torch.bfloat16)
12
  @spaces.GPU
13
- def generate_text(prompt, temperature, top_p, top_k, repetition_penalty, max_length):
14
  # Generate text using the model
15
  generator.model.cuda()
16
  generator.device = torch.device("cuda")
17
  prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
18
  outputs = generator(
19
  prompt,
20
- do_sample=True,
21
- max_new_tokens=max_length,
22
- temperature=temperature,
23
- top_p=top_p,
24
- top_k=top_k,
25
- repetition_penalty=repetition_penalty,
26
  return_full_text=False
27
  )
28
  # Extract the generated text and return it
 
8
 
9
 
10
  # Initialize the model pipeline
11
+ generator = pipeline('text-generation', model='okeanos/uptimeai-8273')
12
  @spaces.GPU
13
+ def generate_text(prompt):
14
  # Generate text using the model
15
  generator.model.cuda()
16
  generator.device = torch.device("cuda")
17
  prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
18
  outputs = generator(
19
  prompt,
20
+ do_sample=True
 
 
 
 
 
21
  return_full_text=False
22
  )
23
  # Extract the generated text and return it