MegaTronX commited on
Commit
05ba171
·
verified ·
1 Parent(s): ebc169c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -28
app.py CHANGED
@@ -11,32 +11,6 @@ MAX_MAX_NEW_TOKENS = 8096
11
  DEFAULT_MAX_NEW_TOKENS = 1024
12
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
13
 
14
- DESCRIPTION = """\
15
- # Uncensored Llama-3.2-3B-Instruct Chat
16
-
17
- This is an uncensored version of the original [Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct), created using [mlabonne](https://huggingface.co/mlabonne)'s [script](https://colab.research.google.com/drive/1VYm3hOcvCpbGiqKZb141gJwjdmmCcVpR?usp=sharing), which builds on [FailSpy's notebook](https://huggingface.co/failspy/llama-3-70B-Instruct-abliterated/blob/main/ortho_cookbook.ipynb) and the original work from [Andy Arditi et al.](https://colab.research.google.com/drive/1a-aQvKC9avdZpdyBn4jgRQFObTPy1JZw?usp=sharing). The method is discussed in details in this [blog](https://huggingface.co/blog/mlabonne/abliteration) and this [paper](https://arxiv.org/abs/2406.11717).
18
-
19
- You can found the uncensored model [here](https://huggingface.co/chuanli11/Llama-3.2-3B-Instruct-uncensored).
20
-
21
- This model is intended for research purposes only and may produce inaccurate or unreliable outputs. Use it cautiously and at your own risk.
22
-
23
-
24
- 🦄 Other exciting ML projects at Lambda: [ML Times](https://news.lambdalabs.com/news/today), [Distributed Training Guide](https://github.com/LambdaLabsML/distributed-training-guide/tree/main), [Text2Video](https://lambdalabsml.github.io/Open-Sora/introduction/), [GPU Benchmark](https://lambdalabs.com/gpu-benchmarks).
25
-
26
- """
27
-
28
- LICENSE = """
29
- <p/>
30
-
31
- ---
32
- As a derivate work of [Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct) by Meta,
33
- this demo is governed by the original [license](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/LICENSE).
34
- """
35
-
36
- # if not torch.cuda.is_available():
37
- # DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
38
-
39
-
40
  if torch.cuda.is_available() or os.getenv("ZERO_GPU_SUPPORT", False):
41
  model_id = "chuanli11/Llama-3.2-3B-Instruct-uncensored"
42
  model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16)
@@ -132,10 +106,10 @@ chat_interface = gr.ChatInterface(
132
  )
133
 
134
  with gr.Blocks(css="style.css", fill_height=True) as demo:
135
- gr.Markdown(DESCRIPTION)
136
  # gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
137
  chat_interface.render()
138
- gr.Markdown(LICENSE)
139
 
140
  if __name__ == "__main__":
141
  demo.queue(max_size=20).launch()
 
11
  DEFAULT_MAX_NEW_TOKENS = 1024
12
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  if torch.cuda.is_available() or os.getenv("ZERO_GPU_SUPPORT", False):
15
  model_id = "chuanli11/Llama-3.2-3B-Instruct-uncensored"
16
  model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16)
 
106
  )
107
 
108
  with gr.Blocks(css="style.css", fill_height=True) as demo:
109
+ #gr.Markdown(DESCRIPTION)
110
  # gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
111
  chat_interface.render()
112
+ #gr.Markdown(LICENSE)
113
 
114
  if __name__ == "__main__":
115
  demo.queue(max_size=20).launch()