wabang commited on
Commit
5dc0c48
ยท
verified ยท
1 Parent(s): f076a18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -3,18 +3,19 @@ import pandas as pd
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  import torch
5
 
6
- # ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๋กœ๋“œ
7
  model_name = "meta-llama/Meta-Llama-3.1-8B"
8
  tokenizer = AutoTokenizer.from_pretrained(model_name)
9
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map="auto")
10
 
 
11
  from huggingface_hub import login
12
  import os
13
 
14
- # ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ํ† ํฐ์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค
15
- hf_token = os.environ.get("HF_TOKEN")
16
 
17
- # ํ† ํฐ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ๊ทธ์ธํ•ฉ๋‹ˆ๋‹ค
18
  if hf_token:
19
  login(token=hf_token)
20
  else:
 
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  import torch
5
 
6
+ # model, tokenizer ์…‹ํŒ…
7
  model_name = "meta-llama/Meta-Llama-3.1-8B"
8
  tokenizer = AutoTokenizer.from_pretrained(model_name)
9
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map="auto")
10
 
11
+ #hugging face ๋กœ๊ทธ์ธ (ํ† ํฐ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด์„œ)
12
  from huggingface_hub import login
13
  import os
14
 
15
+ # ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ํ† ํฐ์„ ๊ฐ€์ ธ์˜ค๊ธฐ
16
+ hf_token = os.environ.get("llama3.31-8b-token-new")
17
 
18
+ # ํ† ํฐ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ๊ทธ์ธ
19
  if hf_token:
20
  login(token=hf_token)
21
  else: