gagan3012 / project-code-py-small

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

Introduction of project-code-py-small

Model Details of project-code-py-small

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-small on huggingface.co

23
Total runs
0
24-hour runs
2
3-day runs
0
7-day runs
4
30-day runs

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

project-code-py-small huggingface.co

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

project-code-py-small huggingface.co Url

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

gagan3012 project-code-py-small online free

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

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

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

project-code-py-small install

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

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

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

Url of project-code-py-small

project-code-py-small huggingface.co Url

Provider of project-code-py-small huggingface.co

gagan3012
ORGANIZATIONS

Other API from gagan3012

huggingface.co

Total runs: 71
Run Growth: 13
Growth Rate: 18.31%
Updated:Janvier 09 2024
huggingface.co

Total runs: 70
Run Growth: 7
Growth Rate: 10.45%
Updated:Janvier 13 2024
huggingface.co

Total runs: 55
Run Growth: -4
Growth Rate: -7.41%
Updated:Mars 12 2021
huggingface.co

Total runs: 36
Run Growth: 12
Growth Rate: 32.43%
Updated:Septembre 22 2021
huggingface.co

Total runs: 33
Run Growth: 17
Growth Rate: 50.00%
Updated:Septembre 22 2021
huggingface.co

Total runs: 33
Run Growth: -22
Growth Rate: -66.67%
Updated:Décembre 09 2022
huggingface.co

Total runs: 30
Run Growth: 26
Growth Rate: 83.87%
Updated:Septembre 22 2021
huggingface.co

Total runs: 28
Run Growth: 20
Growth Rate: 66.67%
Updated:Septembre 22 2021
huggingface.co

Total runs: 24
Run Growth: 17
Growth Rate: 68.00%
Updated:Octobre 30 2022
huggingface.co

Total runs: 22
Run Growth: 1
Growth Rate: 4.76%
Updated:Mars 21 2022
huggingface.co

Total runs: 17
Run Growth: -24
Growth Rate: -126.32%
Updated:Février 08 2022
huggingface.co

Total runs: 18
Run Growth: 11
Growth Rate: 57.89%
Updated:Octobre 19 2021
huggingface.co

Total runs: 17
Run Growth: -7
Growth Rate: -38.89%
Updated:Avril 28 2022
huggingface.co

Total runs: 17
Run Growth: -11
Growth Rate: -61.11%
Updated:Février 08 2022
huggingface.co

Total runs: 18
Run Growth: 8
Growth Rate: 47.06%
Updated:Janvier 20 2024
huggingface.co

Total runs: 14
Run Growth: 4
Growth Rate: 28.57%
Updated:Avril 11 2024
huggingface.co

Total runs: 12
Run Growth: -2
Growth Rate: -16.67%
Updated:Juillet 06 2023
huggingface.co

Total runs: 10
Run Growth: 6
Growth Rate: 54.55%
Updated:Juillet 03 2021
huggingface.co

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

Total runs: 12
Run Growth: 4
Growth Rate: 40.00%
Updated:Juin 15 2023
huggingface.co

Total runs: 8
Run Growth: 1
Growth Rate: 12.50%
Updated:Octobre 13 2023
huggingface.co

Total runs: 6
Run Growth: 0
Growth Rate: 0.00%
Updated:Juillet 10 2021
huggingface.co

Total runs: 8
Run Growth: 1
Growth Rate: 14.29%
Updated:Juin 24 2023
huggingface.co

Total runs: 6
Run Growth: -2
Growth Rate: -33.33%
Updated:Août 22 2023
huggingface.co

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

Total runs: 4
Run Growth: -2
Growth Rate: -50.00%
Updated:Août 16 2023
huggingface.co

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

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:Février 28 2023