ramyaa1113 commited on
Commit
04dd2f1
·
1 Parent(s): 0cfd117

add application file

Browse files
Files changed (2) hide show
  1. app.py +24 -0
  2. requirements.txt +7 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+ from translator.agent import TranslationAgent
4
+
5
+ '''
6
+ #Initialize agent (will load mapping table)
7
+ agent = TranslationAgent()
8
+
9
+
10
+ def do_translate(csharp_code, target_format, model_choice):
11
+ #taget format : "cpp", "BP", "both"
12
+ return agent.translate(csharp_code, target_format=target_format, model_choice=model_choice)
13
+
14
+ title = "Unity -> Unreal Code Translator"
15
+ description = "Paste a Unity C# script and get suggested Unreal C++ (.h/.cpp) and an Unreal Python Blueprint-generator script."
16
+
17
+ '''
18
+
19
+
20
+ def greet(name):
21
+ return "Hello " + name + "!!"
22
+
23
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
24
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ gradio>=4.44.0
2
+ huggingface_hub>=0.25.2
3
+ openai>=1.52.0
4
+ tree_sitter>=0.21.0
5
+ tree_sitter_languages
6
+ black
7
+ pyyaml