gagan3012 / project-code-py

huggingface.co
Total runs: 23
24-hour runs: 0
7-day runs: 1
30-day runs: 15
Model's Last Updated: May 22 2021
text-generation

Introduction of project-code-py

Model Details of project-code-py

Leetcode using AI :robot:

GPT-2 Model for Leetcode Questions in python

Note : the Answers might not make sense in some cases because of the bias in GPT-2

Contribtuions: If you would like to make the model better contributions are welcome Check out CONTRIBUTIONS.md

📢 Favour:

It would be highly motivating, if you can STAR⭐ this repo if you find it helpful.

Model

Two models have been developed for different use cases and they can be found at https://huggingface.co/gagan3012

The model weights can be found here: GPT-2 and DistilGPT-2

Example usage:
from transformers import AutoTokenizer, AutoModelWithLMHead

tokenizer = AutoTokenizer.from_pretrained("gagan3012/project-code-py")

model = AutoModelWithLMHead.from_pretrained("gagan3012/project-code-py")
Demo

Streamlit App

A streamlit webapp has been setup to use the model: https://share.streamlit.io/gagan3012/project-code-py/app.py

image

Example results:
Question:
Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list.
Answer:
""" Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list.

For example,
a = 1->2->3
b = 3->1->2
t = ListNode(-1, 1)

Note: The lexicographic ordering of the nodes in a tree matters. Do not assign values to nodes in a tree.
Example 1:

Input: [1,2,3]
Output: 1->2->5
Explanation: 1->2->3->3->4, then 1->2->5[2] and then 5->1->3->4.


Note:

The length of a linked list will be in the range [1, 1000].
Node.val must be a valid LinkedListNode type.
Both the length and the value of the nodes in a linked list will be in the range [-1000, 1000].
All nodes are distinct.
"""
# Definition for singly-linked list.
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self.next = None

class Solution:
    def deleteNode(self, head: ListNode, val: int) -> None:
        """
        BFS
        Linked List
        :param head: ListNode
        :param val: int
        :return: ListNode
        """
        if head is not None:
            return head
        dummy = ListNode(-1, 1)
        dummy.next = head
        dummy.next.val = val
        dummy.next.next = head
        dummy.val = ""


s1 = Solution()
print(s1.deleteNode(head))
print(s1.deleteNode(-1))
print(s1.deleteNode(-1))

Runs of gagan3012 project-code-py on huggingface.co

23
Total runs
0
24-hour runs
1
3-day runs
1
7-day runs
15
30-day runs

More Information About project-code-py huggingface.co Model

project-code-py huggingface.co

project-code-py huggingface.co is an AI model on huggingface.co that provides project-code-py's model effect (), which can be used instantly with this gagan3012 project-code-py model. huggingface.co supports a free trial of the project-code-py model, and also provides paid use of the project-code-py. Support call project-code-py model through api, including Node.js, Python, http.

project-code-py huggingface.co Url

https://huggingface.co/gagan3012/project-code-py

gagan3012 project-code-py online free

project-code-py huggingface.co is an online trial and call api platform, which integrates project-code-py's modeling effects, including api services, and provides a free online trial of project-code-py, you can try project-code-py online for free by clicking the link below.

gagan3012 project-code-py online free url in huggingface.co:

https://huggingface.co/gagan3012/project-code-py

project-code-py install

project-code-py is an open source model from GitHub that offers a free installation service, and any user can find project-code-py on GitHub to install. At the same time, huggingface.co provides the effect of project-code-py install, users can directly use project-code-py installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

project-code-py install url in huggingface.co:

https://huggingface.co/gagan3012/project-code-py

Url of project-code-py

project-code-py huggingface.co Url

Provider of project-code-py huggingface.co

gagan3012
ORGANIZATIONS

Other API from gagan3012

huggingface.co

Total runs: 69
Run Growth: 16
Growth Rate: 23.53%
Updated:January 13 2024
huggingface.co

Total runs: 67
Run Growth: 14
Growth Rate: 21.21%
Updated:January 09 2024
huggingface.co

Total runs: 57
Run Growth: 14
Growth Rate: 24.14%
Updated:March 12 2021
huggingface.co

Total runs: 32
Run Growth: 14
Growth Rate: 43.75%
Updated:September 22 2021
huggingface.co

Total runs: 32
Run Growth: -20
Growth Rate: -62.50%
Updated:December 09 2022
huggingface.co

Total runs: 32
Run Growth: 1
Growth Rate: 3.13%
Updated:September 22 2021
huggingface.co

Total runs: 27
Run Growth: 23
Growth Rate: 85.19%
Updated:September 22 2021
huggingface.co

Total runs: 27
Run Growth: 20
Growth Rate: 71.43%
Updated:September 22 2021
huggingface.co

Total runs: 24
Run Growth: 10
Growth Rate: 43.48%
Updated:October 30 2022
huggingface.co

Total runs: 18
Run Growth: 7
Growth Rate: 41.18%
Updated:February 08 2022
huggingface.co

Total runs: 17
Run Growth: 11
Growth Rate: 61.11%
Updated:January 20 2024
huggingface.co

Total runs: 16
Run Growth: -9
Growth Rate: -52.94%
Updated:April 28 2022
huggingface.co

Total runs: 16
Run Growth: 10
Growth Rate: 58.82%
Updated:October 19 2021
huggingface.co

Total runs: 16
Run Growth: -9
Growth Rate: -60.00%
Updated:February 08 2022
huggingface.co

Total runs: 15
Run Growth: 7
Growth Rate: 50.00%
Updated:April 11 2024
huggingface.co

Total runs: 10
Run Growth: 2
Growth Rate: 20.00%
Updated:July 03 2021
huggingface.co

Total runs: 9
Run Growth: -10
Growth Rate: -100.00%
Updated:March 21 2022
huggingface.co

Total runs: 7
Run Growth: -11
Growth Rate: -137.50%
Updated:April 27 2022
huggingface.co

Total runs: 7
Run Growth: 0
Growth Rate: 0.00%
Updated:June 24 2023
huggingface.co

Total runs: 6
Run Growth: -2
Growth Rate: -33.33%
Updated:October 13 2023
huggingface.co

Total runs: 6
Run Growth: -2
Growth Rate: -40.00%
Updated:June 15 2023
huggingface.co

Total runs: 6
Run Growth: 1
Growth Rate: 16.67%
Updated:February 02 2023
huggingface.co

Total runs: 5
Run Growth: -3
Growth Rate: -50.00%
Updated:August 22 2023
huggingface.co

Total runs: 4
Run Growth: -4
Growth Rate: -100.00%
Updated:August 16 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 20 2021
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 28 2023