Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
·
8937fd4
1
Parent(s):
d9f8b8b
Load game supports media now?
Browse files
app.py
CHANGED
@@ -652,6 +652,12 @@ Error at line {lineno}, column {colno}:
|
|
652 |
{pointer}
|
653 |
Error details: {str(error)}"""
|
654 |
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
initgameinfo = start_game()
|
656 |
|
657 |
#-----------------------------------------------------------------------------------------------------------------------------------
|
@@ -666,45 +672,67 @@ with gr.Blocks() as demo:
|
|
666 |
<div style="width: 20%; text-align: center">HF + Gradio allows for api use so this my prototype tool for tool use test</div>
|
667 |
</div>""")
|
668 |
with gr.Tab("Skeleton Generator"):
|
669 |
-
with gr.
|
670 |
-
gr.
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
with gr.Row():
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
return show_elements(text)
|
705 |
-
|
706 |
-
with gr.Tab("Asset First"):
|
707 |
-
gr.HTML("Make Asset and make the transitions using LLM")
|
708 |
|
709 |
with gr.Tab("Test Example State Machine"):
|
710 |
with gr.Tab("Config Without Assets"):
|
|
|
652 |
{pointer}
|
653 |
Error details: {str(error)}"""
|
654 |
|
655 |
+
def display_website(link):
|
656 |
+
html = f"<iframe src='{link}' width='100%' height='1000px'></iframe>"
|
657 |
+
gr.Info("If 404 then the space/page has probably been disabled - normally due to a better alternative")
|
658 |
+
return html
|
659 |
+
|
660 |
+
|
661 |
initgameinfo = start_game()
|
662 |
|
663 |
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
672 |
<div style="width: 20%; text-align: center">HF + Gradio allows for api use so this my prototype tool for tool use test</div>
|
673 |
</div>""")
|
674 |
with gr.Tab("Skeleton Generator"):
|
675 |
+
with gr.Row():
|
676 |
+
with gr.Column(scale=1):
|
677 |
+
with gr.Tab("Asset path Assist"):
|
678 |
+
gr.HTML("Make Files and Text ideas for the field and paste")
|
679 |
+
with gr.Accordion("Text"):
|
680 |
+
gr.HTML("Embed of a text sites")
|
681 |
+
with gr.Accordion("LLM HF Spaces/Sites (Click Here to Open) - Use 'Acronym Map Creation Space' Tab with this - Ask for Translation of image tags made below, sentence to emojis, Wordlists, Test Conversations, Get Grammar Explanations etc., Can use GPT-4 or new SOTA to review the conversation", open=False):
|
682 |
+
with gr.Row():
|
683 |
+
linktochat = gr.Dropdown(choices=["https://labs.perplexity.ai/", "https://chat.lmsys.org", "https://sdk.vercel.ai/docs", "https://qwen-qwen-max-0428.hf.space", "https://cohereforai-c4ai-command-r-plus.hf.space", "https://huggingface.co/spaces/eswardivi/Phi-3-mini-128k-instruct", "https://eswardivi-phi-3-mini-4k-instruct.hf.space", "https://cyzgab-catch-me-if-you-can.hf.space", "https://snowflake-snowflake-arctic-st-demo.hf.space", "https://qwen-qwen1-5-110b-chat-demo.hf.space", "https://ysharma-chat-with-meta-llama3-8b.hf.space", "https://databricks-dbrx-instruct.hf.space", "https://qwen-qwen1-5-moe-a2-7b-chat-demo.hf.space", "https://cohereforai-c4ai-command-r-v01.hf.space", "https://ehristoforu-mixtral-46-7b-chat.hf.space", "https://stabilityai-stablelm-2-1-6b-zephyr.hf.space", "https://qwen-qwen1-5-72b-chat.hf.space", "https://deepseek-ai-deepseek-coder-7b-instruct.hf.space", "https://01-ai-yi-34b-chat.hf.space", "https://ysharma-zephyr-playground.hf.space", "https://huggingfaceh4-zephyr-chat.hf.space", "https://osanseviero-mistral-super-fast.hf.space", "https://artificialguybr-qwen-14b-chat-demo.hf.space", "https://huggingface-projects-llama-2-7b-chat.hf.space", "https://ysharma-explore-llamav2-with-tgi.hf.space", "https://mosaicml-mpt-30b-chat.hf.space", "https://huggingfaceh4-falcon-chat.hf.space", "https://uwnlp-guanaco-playground-tgi.hf.space", "https://stabilityai-stablelm-tuned-alpha-chat.hf.space", "https://mosaicml-mpt-7b-storywriter.hf.space", "https://huggingfaceh4-starchat-playground.hf.space", "https://bigcode-bigcode-playground.hf.space", "https://mosaicml-mpt-7b-chat.hf.space", "https://huggingchat-chat-ui.hf.space", "https://togethercomputer-openchatkit.hf.space"], label="Choose/Cancel type any .hf.space link here (can also type a link)'", allow_custom_value=True)
|
684 |
+
chatspacebtn = gr.Button("Use the chosen URL to load interface with a chat model. For sdk.vercel click the chat button on the top left. For lymsys / chat arena copy the link and use a new tab")
|
685 |
+
chatspace = gr.HTML("Chat Space Chosen will load here")
|
686 |
+
chatspacebtn.click(display_website, inputs=linktochat, outputs=chatspace)
|
687 |
+
with gr.Accordion("Other"):
|
688 |
+
with gr.Accordion("Image Gen or Animation HF Spaces/Sites (Click Here to Open) - Use with the image placeholder in Workflows tab", open=False):
|
689 |
+
with gr.Row():
|
690 |
+
linktoimagegen = gr.Dropdown(choices=["https://huggingface.co/spaces/linoyts/scribble-sdxl-flash" "https://prodia-sdxl-stable-diffusion-xl.hf.space", "https://prodia-fast-stable-diffusion.hf.space", "https://lllyasviel-ic-light.hf.space", "https://gparmar-img2img-turbo-sketch.hf.space", "https://artificialguybr-artificialguybr-demo-lora.hf.space", "https://kadirnar-open-sora.hf.space", "https://bytedance-animatediff-lightning.hf.space", "https://bytedance-hyper-sdxl-1step-t2i.hf.space", "https://ehristoforu-dalle-3-xl-lora-v2.hf.space", "https://multimodalart-cosxl.hf.space", "https://radames-real-time-text-to-image-sdxl-lightning.hf.space", "https://cagliostrolab-animagine-xl-3-1.hf.space", "https://wangfuyun-animatelcm-svd.hf.space" "https://modelscope-transferanything.hf.space", "https://visionmaze-magic-me.hf.space", "https://wangfuyun-animatelcm.hf.space", "https://artgan-diffusion-api.hf.space", "https://multimodalart-stable-cascade.hf.space", "https://ap123-sdxl-lightning.hf.space", "https://google-sdxl.hf.space", "https://guoyww-animatediff.hf.space", "https://segmind-segmind-stable-diffusion.hf.space", "https://simianluo-latent-consistency-model.hf.space", "https://artificialguybr-studio-ghibli-lora-sdxl.hf.space", "https://artificialguybr-pixel-art-generator.hf.space", "https://fffiloni-sdxl-control-loras.hf.space"], label="Choose/Cancel type any .hf.space link here (can also type a link)'", allow_custom_value=True)
|
691 |
+
imagegenspacebtn = gr.Button("Use the chosen URL to load interface with a chat model")
|
692 |
+
imagegenspace = gr.HTML("Chat Space Chosen will load here")
|
693 |
+
imagegenspacebtn.click(display_website, inputs=linktoimagegen, outputs=imagegenspace)
|
694 |
+
gr.File(label="Embedded space - Upload creation here")
|
695 |
+
gr.FileExplorer(label="Find the correct paths for things added")
|
696 |
+
with gr.Column(scale=2):
|
697 |
+
with gr.Tab("Schema First"):
|
698 |
+
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
699 |
+
gr.HTML("One prompt to be used to test models - <br>Please make 10 python lists for the types of media files and their purposes in a game and then use those lists to random generate a timeline of 20 items when the function is called <br>Great next suggest ways to improve this function to create better timelines")
|
700 |
+
with gr.Accordion("Proto Config Assist"):
|
701 |
+
gr.Markdown("Editing placeholder")
|
702 |
+
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
|
703 |
+
gr.Markdown("# Story and Timeline Generator")
|
704 |
+
gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events. <br>Ask an LLM to use this to write a story around")
|
705 |
+
with gr.Accordion("JSON with no edits"):
|
706 |
+
with gr.Row():
|
707 |
+
timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
708 |
+
timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
|
709 |
+
story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
|
710 |
+
with gr.Row():
|
711 |
+
game_structure_output_text_with_media = gr.Code(language="json")
|
712 |
+
game_structure_output_text = gr.Code(language="json")
|
713 |
+
|
714 |
with gr.Row():
|
715 |
+
generate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
|
716 |
+
generate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
|
717 |
+
generate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
|
718 |
+
generate_button = gr.Button("Generate Story and Timeline")
|
719 |
+
|
720 |
+
@gr.render(inputs=game_structure_output_text_with_media)
|
721 |
+
def update(game_structure_output_text_with_media):
|
722 |
+
return show_elements_json_input(game_structure_output_text_with_media)
|
723 |
+
|
724 |
+
generate_button.click(generate_story_and_timeline, inputs=[generate_no_ui_timeline_points, generate_no_media_timeline_points, generate_with_media_check], outputs=[timeline_output_with_assets, timeline_output, story_output, game_structure_output_text_with_media, game_structure_output_text])
|
725 |
+
|
726 |
+
gr.HTML("Splits by new line - The idea here was to allow for saving the file ")
|
727 |
+
input_text = gr.Textbox(label="Input Text", lines=10)
|
728 |
+
output_group = gr.Group()
|
729 |
+
|
730 |
+
@gr.render(inputs=input_text)
|
731 |
+
def update(text):
|
732 |
+
return show_elements(text)
|
733 |
+
|
734 |
+
with gr.Tab("Asset First"):
|
735 |
+
gr.HTML("Make Asset and make the transitions using LLM")
|
|
|
|
|
|
|
|
|
736 |
|
737 |
with gr.Tab("Test Example State Machine"):
|
738 |
with gr.Tab("Config Without Assets"):
|