Download utils.py from rakeshkumar1812/text-to-SQL-GenAI-App: direct link, hf CLI and curl.
- Browser
- Download file 793 Bytes
-
https://huggingface.co/spaces/rakeshkumar1812/text-to-SQL-GenAI-App/resolve/main/utils.py
- Command line
-
hf download hf://spaces/rakeshkumar1812/text-to-SQL-GenAI-App/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/rakeshkumar1812/text-to-SQL-GenAI-App/resolve/main/utils.py
793 Bytes
| def remove_triple_quotes(sql_query): | |
| print('the incoming sql_query is :\n', sql_query) | |
| if sql_query.startswith('"""') and sql_query.endswith('"""'): | |
| sql_query = sql_query[3:-3].strip() | |
| print('the outgoing sql_query is :\n', sql_query) | |
| return sql_query | |
| elif sql_query.startswith("'''") and sql_query.endswith("'''"): | |
| sql_query = sql_query[3:-3].strip() | |
| print('the outgoing sql_query is :\n', sql_query) | |
| return sql_query | |
| elif sql_query.startswith("```") and sql_query.endswith("```"): | |
| sql_query = sql_query[3:-3].strip() | |
| print('the outgoing sql_query is :\n', sql_query) | |
| return sql_query | |
| else: | |
| print('the outgoing sql_query is :\n', sql_query) | |
| return sql_query | |