app.py
Browse files
app.py
CHANGED
@@ -122,11 +122,13 @@ parser.add_argument(
|
|
122 |
args = parser.parse_args()
|
123 |
print("Welcome to the LifGenerator CPU script!")
|
124 |
print("This script generates lif files using a Hugging Face model and greedy decoding.")
|
125 |
-
print(f"Input file path: {args.input_file}")
|
126 |
-
print(f"Output file path: {args.output_file}")
|
127 |
INPUT_FILE = args.input_file if args.input_file else "Kangaroos.txt"
|
128 |
INPUT_FILE_STEM = INPUT_FILE.split('.')[0]
|
129 |
OUTPUT_FILE = args.output_file if args.output_file else (INPUT_FILE_STEM + ".lif")
|
|
|
|
|
130 |
PROMPT_ID = args.prompt_id if args.prompt_id else INPUT_FILE
|
131 |
PROMPT_TOPIC = args.prompt_topic if args.prompt_topic else INPUT_FILE
|
132 |
MULTI_PV = args.multi_pv if args.multi_pv else 1000
|
@@ -213,8 +215,8 @@ def main(INPUT_FILE, OUTPUT_FILE, PROMPT_ID, PROMPT_TOPIC, MULTI_PV, NUM_WORDS,
|
|
213 |
# %% Constants and Configuration
|
214 |
# MODEL_NAME = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
215 |
# MODEL_NAME = "google/gemma-3-4b-it"
|
216 |
-
|
217 |
-
MODEL_NAME = "Qwen/Qwen3-0.6B"
|
218 |
# MODEL_NAME = "microsoft/Phi-4-mini-instruct"
|
219 |
#MODEL_NAME = "meta-llama/Llama-2-7b-hf"
|
220 |
#MODEL_NAME = input(f"Enter hugging face model name or press enter to default to [{MODEL_NAME}]: ") or MODEL_NAME
|
@@ -281,8 +283,8 @@ def main(INPUT_FILE, OUTPUT_FILE, PROMPT_ID, PROMPT_TOPIC, MULTI_PV, NUM_WORDS,
|
|
281 |
# LegalNumberOfMove_str = input(" Enter Max Number of moves [Default: 10]: ") or "10"
|
282 |
LegalNumberOfMove = NUM_WORDS # int(LegalNumberOfMove_str)
|
283 |
# EngineID = f"DeepSeek R1 1.5B Qwen-Distil Greedy ({DEVICE.upper()})" # Updated EngineID
|
284 |
-
|
285 |
-
EngineID = f"Qwen/Qwen3-0.6B"
|
286 |
# EngineID = f"Gemma-3-4b-it ({DEVICE.upper()})" # Indicate CPU in EngineID
|
287 |
Depth = 1
|
288 |
print(" User inputs captured.\n")
|
@@ -588,6 +590,7 @@ def main(INPUT_FILE, OUTPUT_FILE, PROMPT_ID, PROMPT_TOPIC, MULTI_PV, NUM_WORDS,
|
|
588 |
def premain():
|
589 |
main("Kangaroos.txt", "KangaroosByQ06.lif", "KangarooEssay", "The Mating Habits of Kangaroos", 100, 1000, 10000, 1, 0, 1, "Qwen")
|
590 |
|
591 |
-
demo = gr.Interface(fn=premain, inputs="text", outputs="text")
|
592 |
-
demo.
|
|
|
593 |
|
|
|
122 |
args = parser.parse_args()
|
123 |
print("Welcome to the LifGenerator CPU script!")
|
124 |
print("This script generates lif files using a Hugging Face model and greedy decoding.")
|
125 |
+
#print(f"Input file path: {args.input_file}")
|
126 |
+
#print(f"Output file path: {args.output_file}")
|
127 |
INPUT_FILE = args.input_file if args.input_file else "Kangaroos.txt"
|
128 |
INPUT_FILE_STEM = INPUT_FILE.split('.')[0]
|
129 |
OUTPUT_FILE = args.output_file if args.output_file else (INPUT_FILE_STEM + ".lif")
|
130 |
+
print(f"Input file path: {INPUT_FILE}")
|
131 |
+
print(f"Output file path: {OUTPUT_FILE}")
|
132 |
PROMPT_ID = args.prompt_id if args.prompt_id else INPUT_FILE
|
133 |
PROMPT_TOPIC = args.prompt_topic if args.prompt_topic else INPUT_FILE
|
134 |
MULTI_PV = args.multi_pv if args.multi_pv else 1000
|
|
|
215 |
# %% Constants and Configuration
|
216 |
# MODEL_NAME = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
217 |
# MODEL_NAME = "google/gemma-3-4b-it"
|
218 |
+
MODEL_NAME = "Qwen/Qwen3-1.7B"
|
219 |
+
# MODEL_NAME = "Qwen/Qwen3-0.6B"
|
220 |
# MODEL_NAME = "microsoft/Phi-4-mini-instruct"
|
221 |
#MODEL_NAME = "meta-llama/Llama-2-7b-hf"
|
222 |
#MODEL_NAME = input(f"Enter hugging face model name or press enter to default to [{MODEL_NAME}]: ") or MODEL_NAME
|
|
|
283 |
# LegalNumberOfMove_str = input(" Enter Max Number of moves [Default: 10]: ") or "10"
|
284 |
LegalNumberOfMove = NUM_WORDS # int(LegalNumberOfMove_str)
|
285 |
# EngineID = f"DeepSeek R1 1.5B Qwen-Distil Greedy ({DEVICE.upper()})" # Updated EngineID
|
286 |
+
EngineID = f"Qwen/Qwen3-1.7B"
|
287 |
+
# EngineID = f"Qwen/Qwen3-0.6B"
|
288 |
# EngineID = f"Gemma-3-4b-it ({DEVICE.upper()})" # Indicate CPU in EngineID
|
289 |
Depth = 1
|
290 |
print(" User inputs captured.\n")
|
|
|
590 |
def premain():
|
591 |
main("Kangaroos.txt", "KangaroosByQ06.lif", "KangarooEssay", "The Mating Habits of Kangaroos", 100, 1000, 10000, 1, 0, 1, "Qwen")
|
592 |
|
593 |
+
#demo = gr.Interface(fn=premain, inputs="text", outputs="text")
|
594 |
+
demo = gr.Interface(fn=premain)
|
595 |
+
demo.launch(share=True)
|
596 |
|