hallisky commited on
Commit
3e8b9ba
·
1 Parent(s): 70aff72

Add some adapters

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -10,7 +10,18 @@ from pathlib import Path
10
 
11
  from huggingface_hub import CommitScheduler
12
 
 
 
 
13
  tokenizer = AutoTokenizer.from_pretrained("gpt2")
 
 
 
 
 
 
 
 
14
 
15
  # Global variable to store the latest obfuscation result
16
  latest_obfuscation = {}
@@ -100,7 +111,7 @@ def greet(input_text, length, function_words, grade_level, sarcasm, formality, v
100
  return response, gr.update(interactive=True), gr.update(interactive=True)
101
 
102
  def reset_sliders():
103
- return [0.5] * 10
104
 
105
  def toggle_slider(checked, value):
106
  if checked:
 
10
 
11
  from huggingface_hub import CommitScheduler
12
 
13
+ # TODO make it so that feedback is only saved on prev. example if user makes another obfuscation
14
+ # and changes slider but doesn't hit obfuscate
15
+
16
  tokenizer = AutoTokenizer.from_pretrained("gpt2")
17
+ MODEL_PATHS = {
18
+ "length_more": "hallisky/lora-length-long-llama-3-8b",
19
+ "length_less": "hallisky/lora-length-long-llama-3-8b",
20
+ "function_more": "hallisky/lora-function-more-llama-3-8b",
21
+ "function_less": "hallisky/lora-function-less-llama-3-8b",
22
+ "grade_more": "hallisky/lora-grade-highschool-llama-3-8b",
23
+ "grade_less": "hallisky/lora-grade-elementary-llama-3-8b",
24
+ }
25
 
26
  # Global variable to store the latest obfuscation result
27
  latest_obfuscation = {}
 
111
  return response, gr.update(interactive=True), gr.update(interactive=True)
112
 
113
  def reset_sliders():
114
+ return [0.5] * 7 + [0] * 3
115
 
116
  def toggle_slider(checked, value):
117
  if checked: