leonardlin commited on
Commit
e93a3af
·
verified ·
1 Parent(s): e8b4082

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -12,9 +12,9 @@ DEFAULT_MAX_NEW_TOKENS = 1024
12
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
13
 
14
  DESCRIPTION = """\
15
- # shisa-v2-llama3.1-8b
16
 
17
- This Space demonstrates the [shisa-v2-llama3.1-8b](https://huggingface.co/shisa-ai/shisa-v2-llama3.1-8b) bilingual (JA/EN) chat model."""
18
 
19
  LICENSE = """
20
  """
@@ -24,7 +24,7 @@ if not torch.cuda.is_available():
24
 
25
 
26
  if torch.cuda.is_available():
27
- model_id = "shisa-ai/shisa-v2-llama3.1-8b"
28
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
29
  tokenizer = AutoTokenizer.from_pretrained(model_id)
30
  tokenizer.use_default_system_prompt = False
@@ -38,8 +38,7 @@ def generate(
38
  max_new_tokens: int = 1024,
39
  temperature: float = 0.6,
40
  top_p: float = 0.9,
41
- top_k: int = 50,
42
- repetition_penalty: float = 1.2,
43
  ) -> Iterator[str]:
44
  conversation = []
45
  if system_prompt:
@@ -111,7 +110,7 @@ chat_interface = gr.ChatInterface(
111
  minimum=1.0,
112
  maximum=2.0,
113
  step=0.05,
114
- value=1.2,
115
  ),
116
  ],
117
  stop_btn=None,
 
12
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
13
 
14
  DESCRIPTION = """\
15
+ # shisa-v2-unphi4-14b
16
 
17
+ This Space demonstrates the [shisa-v2-unphi4-14b](https://huggingface.co/shisa-ai/shisa-v2-unphi4-14b) bilingual (JA/EN) chat model."""
18
 
19
  LICENSE = """
20
  """
 
24
 
25
 
26
  if torch.cuda.is_available():
27
+ model_id = "shisa-ai/shisa-v2-unphi4-14b"
28
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
29
  tokenizer = AutoTokenizer.from_pretrained(model_id)
30
  tokenizer.use_default_system_prompt = False
 
38
  max_new_tokens: int = 1024,
39
  temperature: float = 0.6,
40
  top_p: float = 0.9,
41
+ repetition_penalty: float = 1.1,
 
42
  ) -> Iterator[str]:
43
  conversation = []
44
  if system_prompt:
 
110
  minimum=1.0,
111
  maximum=2.0,
112
  step=0.05,
113
+ value=1.1,
114
  ),
115
  ],
116
  stop_btn=None,