JUNGU commited on
Commit
b693a74
โ€ข
1 Parent(s): 52fa8dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -8,17 +8,8 @@ from transformers import (
8
  import os
9
  from threading import Thread
10
  import spaces
11
- import time
12
  import subprocess
13
 
14
- from transformers_modules.apple.OpenELM-3B-Instruct.d3c76da586450c73898e6bed70cecf3376300fb3.configuration_openelm import OpenELMConfig
15
-
16
- from transformers_modules.apple.OpenELM_3B_Instruct.d3c76da586450c73898e6bed70cecf3376300fb3.configuration_openelm import OpenELMConfig
17
- from transformers import AutoConfig, AutoTokenizer
18
-
19
- config = AutoConfig.from_pretrained("apple/OpenELM-270M", trust_remote_code=True)
20
-
21
-
22
  # flash-attn ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜. CUDA ๋นŒ๋“œ๋Š” ๊ฑด๋„ˆ๋œ€.
23
  subprocess.run(
24
  "pip install flash-attn --no-build-isolation",
@@ -29,21 +20,16 @@ subprocess.run(
29
  # Hugging Face ํ† ํฐ ๊ฐ€์ ธ์˜ค๊ธฐ
30
  token = os.environ["HF_TOKEN"]
31
 
32
- # microsoft/Phi-3-mini-128k-instruct ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๊ฐ™์ด ๋กœ๋“œ
33
- # beomi/Llama-3-KoEn-8B-Instruct-preview ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๊ฐ™์ด ๋กœ๋“œ
34
  model = AutoModelForCausalLM.from_pretrained(
35
- # "microsoft/Phi-3-mini-128k-instruct",
36
  "apple/OpenELM-270M",
37
  token=token,
38
  trust_remote_code=True,
39
  )
40
- # bug fix
41
- # tok = AutoTokenizer.from_pretrained("apple/OpenELM-3B-Instruct", token=token, trust_remote_code=True)
42
  tok = AutoTokenizer.from_pretrained(
43
  "apple/OpenELM-270M",
44
  token=token,
45
  trust_remote_code=True,
46
- config=OpenELMConfig(),
47
  )
48
 
49
  # ์ข…๋ฃŒ ํ† ํฐ ID ์„ค์ •
@@ -130,7 +116,7 @@ demo = gr.ChatInterface(
130
  ],
131
  stop_btn="Stop Generation",
132
  title="Chat With LLMs",
133
- description="Now Running [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)",
134
  )
135
 
136
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
 
8
  import os
9
  from threading import Thread
10
  import spaces
 
11
  import subprocess
12
 
 
 
 
 
 
 
 
 
13
  # flash-attn ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜. CUDA ๋นŒ๋“œ๋Š” ๊ฑด๋„ˆ๋œ€.
14
  subprocess.run(
15
  "pip install flash-attn --no-build-isolation",
 
20
  # Hugging Face ํ† ํฐ ๊ฐ€์ ธ์˜ค๊ธฐ
21
  token = os.environ["HF_TOKEN"]
22
 
23
+ # apple/OpenELM-270M ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๋กœ๋“œ
 
24
  model = AutoModelForCausalLM.from_pretrained(
 
25
  "apple/OpenELM-270M",
26
  token=token,
27
  trust_remote_code=True,
28
  )
 
 
29
  tok = AutoTokenizer.from_pretrained(
30
  "apple/OpenELM-270M",
31
  token=token,
32
  trust_remote_code=True,
 
33
  )
34
 
35
  # ์ข…๋ฃŒ ํ† ํฐ ID ์„ค์ •
 
116
  ],
117
  stop_btn="Stop Generation",
118
  title="Chat With LLMs",
119
+ description="Now Running [apple/OpenELM-270M](https://huggingface.co/apple/OpenELM-270M)",
120
  )
121
 
122
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰