gokaygokay commited on
Commit
97bb67c
·
verified ·
1 Parent(s): a7438d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -6
app.py CHANGED
@@ -42,20 +42,41 @@ def create_video_interface():
42
  custom_elements = gr.Textbox(label="Custom Technical Elements",
43
  placeholder="e.g., Infrared hybrid, Datamosh transitions")
44
 
 
 
 
45
  provider = gr.Dropdown(
46
  choices=["Hugging Face", "Groq", "SambaNova"],
47
  value="Hugging Face",
48
  label="LLM Provider"
49
  )
50
- model = gr.Dropdown(label="Model", value="meta-llama/Meta-Llama-3.1-70B-Instruct")
 
 
 
51
 
52
- generate_btn = gr.Button("Generate Video Blueprint", variant="primary")
53
- output = gr.Textbox(label="Video Production Prompt", lines=12, interactive=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  generate_btn.click(
56
  llm_node.generate_video_prompt,
57
- inputs=[input_concept, duration, style, camera_style, pacing, special_effects,
58
- custom_elements, provider, model],
59
  outputs=output
60
  )
61
 
@@ -63,4 +84,6 @@ def create_video_interface():
63
 
64
  if __name__ == "__main__":
65
  demo = create_video_interface()
66
- demo.launch(share=True)
 
 
 
42
  custom_elements = gr.Textbox(label="Custom Technical Elements",
43
  placeholder="e.g., Infrared hybrid, Datamosh transitions")
44
 
45
+ with gr.Row():
46
+ custom_elements = gr.Textbox(label="Custom Elements", scale=3)
47
+ with gr.Column(scale=1):
48
  provider = gr.Dropdown(
49
  choices=["Hugging Face", "Groq", "SambaNova"],
50
  value="Hugging Face",
51
  label="LLM Provider"
52
  )
53
+ model = gr.Dropdown(label="Model", value="Qwen/Qwen2.5-72B-Instruct")
54
+
55
+ generate_btn = gr.Button("Generate Video Prompt", variant="primary")
56
+ output = gr.Textbox(label="Generated Prompt", lines=12, show_copy_button=True)
57
 
58
+ def update_models(provider):
59
+ models = {
60
+ "Hugging Face": [
61
+ "Qwen/Qwen2.5-72B-Instruct",
62
+ "meta-llama/Meta-Llama-3.1-70B-Instruct",
63
+ "mistralai/Mixtral-8x7B-Instruct-v0.1",
64
+ "mistralai/Mistral-7B-Instruct-v0.3"
65
+ ],
66
+ "Groq": ["llama-3.1-70b-versatile"],
67
+ "SambaNova": [
68
+ "Meta-Llama-3.1-70B-Instruct",
69
+ "Meta-Llama-3.1-405B-Instruct",
70
+ "Meta-Llama-3.1-8B-Instruct"
71
+ ]
72
+ }
73
+ return gr.Dropdown(choices=models[provider], value=models[provider][0])
74
+
75
+ provider.change(update_models, inputs=provider, outputs=model)
76
 
77
  generate_btn.click(
78
  llm_node.generate_video_prompt,
79
+ inputs=[input_concept, duration, style, camera_style, pacing, special_effects, custom_elements, provider, model],
 
80
  outputs=output
81
  )
82
 
 
84
 
85
  if __name__ == "__main__":
86
  demo = create_video_interface()
87
+ demo.launch(share=True)
88
+
89
+ return demo