wowsinfo / conversion

Convert/Migrate from one programming language to another using any LLM
GNU Affero General Public License v3.0
0 stars 0 forks source link

Issues with the current attempt #1

Closed HenryQuan closed 4 weeks ago

HenryQuan commented 1 month ago

Clearly, the generated code doesn't compile due to over 8000 errors. This is as expected from the beginning. Even though my local LLM performs very well, they are still quite limited. The main problem is with the context and cross domain knowledge. Flutter and React Native have different APIs and libraries. Kotlin and Swift also have their ecosystem. A simple one to one mapping will result in unknown imports. Well, that class/namespace may not even have an equivalent. If I want to move further, I may need to continue with https://github.com/wowsinfo/wowsinfo-core. Those generated code is at least Kotlin, so it may help with this major refactor.

Overall, it was a great attempy nevertheless. There are more than 12,000 lines of code generated in under an hour. Regardless of the quality or accuracy, this may assist me significantly in the future. I will continue improving my prompts and work on further refinements using local LLM or OpenAI (for larger files over 1000 lines). My previous implementation isn't great, but any help those generated code will worth it. Since the Android version has been removed, maybe next time when it is back, it can be in a native app using Compose and Kotlin, https://github.com/wowsinfo/react-native-app/issues/3.

HenryQuan commented 1 month ago

Remember to also get the previous Flutter version from https://github.com/wowsinfo/WoWs-Info-Seven/commits/feature/search/?before=34264d6629b90e1d17cb32ce719fcca6148d2366+166. This one has the player page mostly done I believe, will check a bit more later.

HenryQuan commented 1 month ago

There could be another approach where I break down all files into function block first, then merge back into a file. In case, any part fails, I can also replace it with the original so I can update later. This should solve the issue with those huge files and potentially improve the overall performance. This may reduce the load for the GPU also since the token is smaller, remember to set the temperature lower also. For different languages, I may also provide a different backend to handle different languages to break things down better. Ultimately, I want to develop something to quickly scan through all existing files and create a database so the model can understand better?

HenryQuan commented 1 month ago

It seems to be better now with 69387b5ce97e4b5b1e1f6fae9d01eb187b55273b, but the model is still smart enough and output more code than needed. The quality is definitely improved, but it will require further manual reviews to ensure everything are working fine, will experiment more on top_p and maybe other parameters.

HenryQuan commented 1 month ago

The second attempt is now completed. I used the OpenAI GPT 4o mini model instead of my local ones for the speed. Local ones run slower and have worse performance due to their parameter size. It still won't run, but at least it looks better this time. More manual adjustments will be needed. Once I get the Flutter app fixed, I can try converting the entire Flutter project to Kotlin also. I can experiment with Swift & SwiftUI next time if needed.

HenryQuan commented 4 weeks ago

Convert should be completed by now. A ConsoleBackend is provided and Migration is now available to migrate an entire project. Manual review is definitely needed, but it should make life much much better. Next step, I will continue with my wowsinfo-core and focus on the service part.